Skip to content

Commit

Permalink
fix(ci): lint with clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
aganders3 authored and jturner314 committed Jul 30, 2022
1 parent 739316e commit ff74996
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/data_traits.rs
Expand Up @@ -162,6 +162,7 @@ pub unsafe trait DataMut: Data + RawDataMut {
/// Returns whether the array has unique access to its data.
#[doc(hidden)]
#[inline]
#[allow(clippy::wrong_self_convention)] // mut needed for Arc types
fn is_unique(&mut self) -> bool {
self.try_is_unique().unwrap()
}
Expand Down
1 change: 1 addition & 0 deletions src/impl_constructors.rs
Expand Up @@ -634,6 +634,7 @@ where

#[deprecated(note = "This method is hard to use correctly. Use `uninit` instead.",
since = "0.15.0")]
#[allow(clippy::uninit_vec)] // this is explicitly intended to create uninitialized memory
/// Create an array with uninitialized elements, shape `shape`.
///
/// Prefer to use [`uninit()`](ArrayBase::uninit) if possible, because it is
Expand Down
18 changes: 8 additions & 10 deletions src/iterators/lanes.rs
Expand Up @@ -39,17 +39,16 @@ impl<'a, A, D: Dimension> Lanes<'a, A, D> {
let ndim = v.ndim();
let len;
let stride;
let iter_v;
if ndim == 0 {
let iter_v = if ndim == 0 {
len = 1;
stride = 1;
iter_v = v.try_remove_axis(Axis(0))
v.try_remove_axis(Axis(0))
} else {
let i = axis.index();
len = v.dim[i];
stride = v.strides[i] as isize;
iter_v = v.try_remove_axis(axis)
}
v.try_remove_axis(axis)
};
Lanes {
inner_len: len,
inner_stride: stride,
Expand Down Expand Up @@ -108,17 +107,16 @@ impl<'a, A, D: Dimension> LanesMut<'a, A, D> {
let ndim = v.ndim();
let len;
let stride;
let iter_v;
if ndim == 0 {
let iter_v = if ndim == 0 {
len = 1;
stride = 1;
iter_v = v.try_remove_axis(Axis(0))
v.try_remove_axis(Axis(0))
} else {
let i = axis.index();
len = v.dim[i];
stride = v.strides[i] as isize;
iter_v = v.try_remove_axis(axis)
}
v.try_remove_axis(axis)
};
LanesMut {
inner_len: len,
inner_stride: stride,
Expand Down

0 comments on commit ff74996

Please sign in to comment.