Skip to content

Commit

Permalink
Fix nightly lints
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Feb 26, 2024
1 parent 5981cce commit e8a874e
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/array_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::fmt;
use std::marker::PhantomData;
use alloc::format;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::imp_prelude::*;
Expand Down
3 changes: 2 additions & 1 deletion src/arrayformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ where
#[cfg(test)]
mod formatting_with_omit {
use itertools::Itertools;
use std::fmt;
#[cfg(not(feature = "std"))]
use alloc::string::String;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use super::*;
Expand Down
5 changes: 4 additions & 1 deletion src/arraytraits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::iter::IntoIterator;
use std::mem;
use std::ops::{Index, IndexMut};
use std::{hash, mem::size_of};
Expand Down Expand Up @@ -115,6 +116,7 @@ where

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

/// Return `true` if the array shapes and all elements of `self` and
/// `rhs` are equal. Return `false` otherwise.
#[allow(clippy::unconditional_recursion)] // false positive
impl<'a, A, B, S, S2, D> PartialEq<ArrayBase<S2, D>> for &'a ArrayBase<S, D>
where
A: PartialEq<B>,
Expand Down
2 changes: 2 additions & 0 deletions src/data_repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use std::mem;
use std::mem::ManuallyDrop;
use std::ptr::NonNull;
use alloc::slice;
#[cfg(not(feature = "std"))]
use alloc::borrow::ToOwned;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use crate::extension::nonnull;

Expand Down
1 change: 1 addition & 0 deletions src/data_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::mem::{self, size_of};
use std::mem::MaybeUninit;
use std::ptr::NonNull;
use alloc::sync::Arc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::{
Expand Down
7 changes: 0 additions & 7 deletions src/dimension/axes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ where

trait IncOps: Copy {
fn post_inc(&mut self) -> Self;
fn post_dec(&mut self) -> Self;
fn pre_dec(&mut self) -> Self;
}

Expand All @@ -155,12 +154,6 @@ impl IncOps for usize {
x
}
#[inline(always)]
fn post_dec(&mut self) -> Self {
let x = *self;
*self -= 1;
x
}
#[inline(always)]
fn pre_dec(&mut self) -> Self {
*self -= 1;
*self
Expand Down
1 change: 1 addition & 0 deletions src/dimension/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use num_traits::Zero;
use std::ops::{Index, IndexMut};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::{Dim, Dimension, Ix, Ix1, IxDyn, IxDynImpl};
Expand Down
1 change: 1 addition & 0 deletions src/dimension/dimension_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use std::fmt::Debug;
use std::ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign};
use std::ops::{Index, IndexMut};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use super::axes_of;
Expand Down
2 changes: 2 additions & 0 deletions src/dimension/dynindeximpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use crate::imp_prelude::*;
use std::hash::{Hash, Hasher};
use std::ops::{Deref, DerefMut, Index, IndexMut};
use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
const CAP: usize = 4;

Expand Down
1 change: 1 addition & 0 deletions src/extension/nonnull.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::ptr::NonNull;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Return a NonNull<T> pointer to the vector's data
Expand Down
1 change: 1 addition & 0 deletions src/free_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// except according to those terms.

use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::mem::{forget, size_of};

Expand Down
1 change: 1 addition & 0 deletions src/impl_1d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// except according to those terms.

//! Methods for one-dimensional arrays.
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::mem::MaybeUninit;

Expand Down
1 change: 1 addition & 0 deletions src/impl_constructors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use num_traits::{One, Zero};
use std::mem;
use std::mem::MaybeUninit;
use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::dimension;
Expand Down
1 change: 1 addition & 0 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use std::mem::{size_of, ManuallyDrop};
use alloc::slice;
use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use rawpointer::PointerExt;

Expand Down
1 change: 0 additions & 1 deletion src/impl_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ mod arithmetic_ops {
use super::*;
use crate::imp_prelude::*;

use num_complex::Complex;
use std::ops::*;

fn clone_opf<A: Clone, B: Clone, C>(f: impl Fn(A, B) -> C) -> impl FnMut(&A, &B) -> C {
Expand Down
1 change: 1 addition & 0 deletions src/impl_owned_array.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::mem;
use std::mem::MaybeUninit;
Expand Down
1 change: 1 addition & 0 deletions src/iterators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mod windows;
use std::iter::FromIterator;
use std::marker::PhantomData;
use std::ptr;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::Ix1;
Expand Down
1 change: 1 addition & 0 deletions src/linalg/impl_linalg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::{LinalgScalar, Zip};

use std::any::TypeId;
use std::mem::MaybeUninit;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use num_complex::Complex;
Expand Down
2 changes: 1 addition & 1 deletion src/numeric/impl_numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#[cfg(feature = "std")]
use num_traits::Float;
use num_traits::{self, FromPrimitive, Zero};
use num_traits::{FromPrimitive, Zero};
use std::ops::{Add, Div, Mul};

use crate::imp_prelude::*;
Expand Down
1 change: 1 addition & 0 deletions src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use crate::dimension::slices_intersect;
use crate::error::{ErrorKind, ShapeError};
use crate::{ArrayViewMut, DimAdd, Dimension, Ix0, Ix1, Ix2, Ix3, Ix4, Ix5, Ix6, IxDyn};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::convert::TryFrom;
use std::fmt;
Expand Down
1 change: 1 addition & 0 deletions src/split_at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub(crate) trait SplitAt {
}

pub(crate) trait SplitPreference : SplitAt {
#[allow(dead_code)]
fn can_split(&self) -> bool;
fn split_preference(&self) -> (Axis, usize);
fn split(self) -> (Self, Self) where Self: Sized {
Expand Down
1 change: 1 addition & 0 deletions src/stacking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::dimension;
Expand Down
2 changes: 1 addition & 1 deletion tests/iterators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
)]

use ndarray::prelude::*;
use ndarray::{arr3, aview1, indices, s, Axis, Slice, Zip};
use ndarray::{arr3, indices, s, Slice, Zip};

use itertools::assert_equal;
use itertools::enumerate;
Expand Down

0 comments on commit e8a874e

Please sign in to comment.