Skip to content

Commit bfb7ad8

Browse files
aganders3jturner314
authored andcommitted
fix(ci): lint with clippy
1 parent 1839ec6 commit bfb7ad8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/data_traits.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ pub unsafe trait DataMut: Data + RawDataMut {
162162
/// Returns whether the array has unique access to its data.
163163
#[doc(hidden)]
164164
#[inline]
165+
#[allow(clippy::wrong_self_convention)] // mut needed for Arc types
165166
fn is_unique(&mut self) -> bool {
166167
self.try_is_unique().unwrap()
167168
}

src/impl_constructors.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ where
634634

635635
#[deprecated(note = "This method is hard to use correctly. Use `uninit` instead.",
636636
since = "0.15.0")]
637+
#[allow(clippy::uninit_vec)] // this is explicitly intended to create uninitialized memory
637638
/// Create an array with uninitialized elements, shape `shape`.
638639
///
639640
/// Prefer to use [`uninit()`](ArrayBase::uninit) if possible, because it is

src/iterators/lanes.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@ impl<'a, A, D: Dimension> Lanes<'a, A, D> {
3939
let ndim = v.ndim();
4040
let len;
4141
let stride;
42-
let iter_v;
43-
if ndim == 0 {
42+
let iter_v = if ndim == 0 {
4443
len = 1;
4544
stride = 1;
46-
iter_v = v.try_remove_axis(Axis(0))
45+
v.try_remove_axis(Axis(0))
4746
} else {
4847
let i = axis.index();
4948
len = v.dim[i];
5049
stride = v.strides[i] as isize;
51-
iter_v = v.try_remove_axis(axis)
52-
}
50+
v.try_remove_axis(axis)
51+
};
5352
Lanes {
5453
inner_len: len,
5554
inner_stride: stride,
@@ -108,17 +107,16 @@ impl<'a, A, D: Dimension> LanesMut<'a, A, D> {
108107
let ndim = v.ndim();
109108
let len;
110109
let stride;
111-
let iter_v;
112-
if ndim == 0 {
110+
let iter_v = if ndim == 0 {
113111
len = 1;
114112
stride = 1;
115-
iter_v = v.try_remove_axis(Axis(0))
113+
v.try_remove_axis(Axis(0))
116114
} else {
117115
let i = axis.index();
118116
len = v.dim[i];
119117
stride = v.strides[i] as isize;
120-
iter_v = v.try_remove_axis(axis)
121-
}
118+
v.try_remove_axis(axis)
119+
};
122120
LanesMut {
123121
inner_len: len,
124122
inner_stride: stride,

0 commit comments

Comments
 (0)