Skip to content

Commit 87a6448

Browse files
committed
Fix clippy warnings
1 parent fbf2f28 commit 87a6448

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

src/data_traits.rs

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ pub unsafe trait RawDataClone: RawData {
9494
pub unsafe trait Data: RawData {
9595
/// Converts the array to a uniquely owned array, cloning elements if necessary.
9696
#[doc(hidden)]
97+
#[allow(clippy::wrong_self_convention)]
9798
fn into_owned<D>(self_: ArrayBase<Self, D>) -> ArrayBase<OwnedRepr<Self::Elem>, D>
9899
where
99100
Self::Elem: Clone,
@@ -102,6 +103,7 @@ pub unsafe trait Data: RawData {
102103
/// Return a shared ownership (copy on write) array based on the existing one,
103104
/// cloning elements if necessary.
104105
#[doc(hidden)]
106+
#[allow(clippy::wrong_self_convention)]
105107
fn to_shared<D>(self_: &ArrayBase<Self, D>) -> ArrayBase<OwnedArcRepr<Self::Elem>, D>
106108
where
107109
Self::Elem: Clone,

src/dimension/dynindeximpl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<T: Copy + Zero> IxDynRepr<T> {
5151
pub fn copy_from(x: &[T]) -> Self {
5252
if x.len() <= CAP {
5353
let mut arr = [T::zero(); CAP];
54-
arr[..x.len()].copy_from_slice(&x[..]);
54+
arr[..x.len()].copy_from_slice(x);
5555
IxDynRepr::Inline(x.len() as _, arr)
5656
} else {
5757
Self::from(x)

src/impl_constructors.rs

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ where
7373
///
7474
/// let array = Array::from_iter(0..10);
7575
/// ```
76+
#[allow(clippy::should_implement_trait)]
7677
pub fn from_iter<I: IntoIterator<Item = A>>(iterable: I) -> Self {
7778
Self::from_vec(iterable.into_iter().collect())
7879
}

src/impl_internal_constructors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ where
2525
/// See ArrayView::from_shape_ptr for general pointer validity documentation.
2626
pub(crate) unsafe fn from_data_ptr(data: S, ptr: NonNull<A>) -> Self {
2727
let array = ArrayBase {
28-
data: data,
29-
ptr: ptr,
28+
data,
29+
ptr,
3030
dim: Ix1(0),
3131
strides: Ix1(1),
3232
};

src/linalg/impl_linalg.rs

+1
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ pub fn general_mat_vec_mul<A, S1, S2, S3>(
613613
///
614614
/// The caller must ensure that the raw view is valid for writing.
615615
/// the destination may be uninitialized iff beta is zero.
616+
#[allow(clippy::collapsible_else_if)]
616617
unsafe fn general_mat_vec_mul_impl<A, S1, S2>(
617618
alpha: A,
618619
a: &ArrayBase<S1, Ix2>,

0 commit comments

Comments
 (0)