Skip to content

Commit 30bdfee

Browse files
blussadamreichold
andcommitted
Fix nightly lints
Co-authored-by: Adam Reichold <[email protected]>
1 parent 5981cce commit 30bdfee

23 files changed

+27
-12
lines changed

src/array_serde.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
1212
use std::fmt;
1313
use std::marker::PhantomData;
1414
use alloc::format;
15+
#[cfg(not(feature = "std"))]
1516
use alloc::vec::Vec;
1617

1718
use crate::imp_prelude::*;

src/arrayformat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ where
285285
#[cfg(test)]
286286
mod formatting_with_omit {
287287
use itertools::Itertools;
288-
use std::fmt;
288+
#[cfg(not(feature = "std"))]
289289
use alloc::string::String;
290+
#[cfg(not(feature = "std"))]
290291
use alloc::vec::Vec;
291292

292293
use super::*;

src/arraytraits.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9+
#[cfg(not(feature = "std"))]
910
use alloc::boxed::Box;
11+
#[cfg(not(feature = "std"))]
1012
use alloc::vec::Vec;
11-
use std::iter::IntoIterator;
1213
use std::mem;
1314
use std::ops::{Index, IndexMut};
1415
use std::{hash, mem::size_of};
@@ -115,6 +116,7 @@ where
115116

116117
/// Return `true` if the array shapes and all elements of `self` and
117118
/// `rhs` are equal. Return `false` otherwise.
119+
#[allow(clippy::unconditional_recursion)] // false positive
118120
impl<'a, A, B, S, S2, D> PartialEq<&'a ArrayBase<S2, D>> for ArrayBase<S, D>
119121
where
120122
A: PartialEq<B>,
@@ -129,6 +131,7 @@ where
129131

130132
/// Return `true` if the array shapes and all elements of `self` and
131133
/// `rhs` are equal. Return `false` otherwise.
134+
#[allow(clippy::unconditional_recursion)] // false positive
132135
impl<'a, A, B, S, S2, D> PartialEq<ArrayBase<S2, D>> for &'a ArrayBase<S, D>
133136
where
134137
A: PartialEq<B>,

src/data_repr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use std::mem;
22
use std::mem::ManuallyDrop;
33
use std::ptr::NonNull;
44
use alloc::slice;
5+
#[cfg(not(feature = "std"))]
56
use alloc::borrow::ToOwned;
7+
#[cfg(not(feature = "std"))]
68
use alloc::vec::Vec;
79
use crate::extension::nonnull;
810

src/data_traits.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::mem::{self, size_of};
1414
use std::mem::MaybeUninit;
1515
use std::ptr::NonNull;
1616
use alloc::sync::Arc;
17+
#[cfg(not(feature = "std"))]
1718
use alloc::vec::Vec;
1819

1920
use crate::{

src/dimension/axes.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ where
143143

144144
trait IncOps: Copy {
145145
fn post_inc(&mut self) -> Self;
146-
fn post_dec(&mut self) -> Self;
147146
fn pre_dec(&mut self) -> Self;
148147
}
149148

@@ -155,12 +154,6 @@ impl IncOps for usize {
155154
x
156155
}
157156
#[inline(always)]
158-
fn post_dec(&mut self) -> Self {
159-
let x = *self;
160-
*self -= 1;
161-
x
162-
}
163-
#[inline(always)]
164157
fn pre_dec(&mut self) -> Self {
165158
*self -= 1;
166159
*self

src/dimension/conversion.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
use num_traits::Zero;
1212
use std::ops::{Index, IndexMut};
13+
#[cfg(not(feature = "std"))]
1314
use alloc::vec::Vec;
1415

1516
use crate::{Dim, Dimension, Ix, Ix1, IxDyn, IxDynImpl};

src/dimension/dimension_trait.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use std::fmt::Debug;
1010
use std::ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign};
1111
use std::ops::{Index, IndexMut};
12+
#[cfg(not(feature = "std"))]
1213
use alloc::vec::Vec;
1314

1415
use super::axes_of;

src/dimension/dynindeximpl.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use crate::imp_prelude::*;
22
use std::hash::{Hash, Hasher};
33
use std::ops::{Deref, DerefMut, Index, IndexMut};
44
use alloc::vec;
5+
#[cfg(not(feature = "std"))]
56
use alloc::boxed::Box;
7+
#[cfg(not(feature = "std"))]
68
use alloc::vec::Vec;
79
const CAP: usize = 4;
810

src/extension/nonnull.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::ptr::NonNull;
2+
#[cfg(not(feature = "std"))]
23
use alloc::vec::Vec;
34

45
/// Return a NonNull<T> pointer to the vector's data

0 commit comments

Comments
 (0)