Skip to content

Commit 4374a9c

Browse files
ChayimFriedman2adamreichold
authored andcommitted
Use clone_from() in two places
In `fill()` and in `assign()`.
1 parent 23d7cab commit 4374a9c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/impl_methods.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ where
14311431
///
14321432
/// The windows are all distinct views of size `window_size`
14331433
/// that fit into the array's shape.
1434-
///
1434+
///
14351435
/// The stride is ordered by the outermost axis.<br>
14361436
/// Hence, a (x₀, x₁, ..., xₙ) stride will be applied to
14371437
/// (A₀, A₁, ..., Aₙ) where Aₓ stands for `Axis(x)`.
@@ -1441,7 +1441,7 @@ where
14411441
///
14421442
/// The produced element is an `ArrayView<A, D>` with exactly the dimension
14431443
/// `window_size`.
1444-
///
1444+
///
14451445
/// Note that passing a stride of only ones is similar to
14461446
/// calling [`ArrayBase::windows()`].
14471447
///
@@ -2374,7 +2374,7 @@ where
23742374
A: Clone,
23752375
S2: Data<Elem = A>,
23762376
{
2377-
self.zip_mut_with(rhs, |x, y| *x = y.clone());
2377+
self.zip_mut_with(rhs, |x, y| x.clone_from(y));
23782378
}
23792379

23802380
/// Perform an elementwise assigment of values cloned from `self` into array or producer `to`.
@@ -2400,7 +2400,7 @@ where
24002400
S: DataMut,
24012401
A: Clone,
24022402
{
2403-
self.map_inplace(move |elt| *elt = x.clone());
2403+
self.map_inplace(move |elt| elt.clone_from(&x));
24042404
}
24052405

24062406
pub(crate) fn zip_mut_with_same_shape<B, S2, E, F>(&mut self, rhs: &ArrayBase<S2, E>, mut f: F)

0 commit comments

Comments
 (0)