Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use clone_from() in two places
In `fill()` and in `assign()`.
  • Loading branch information
ChayimFriedman2 committed Jan 7, 2024
commit 7b8d0319cd0375aa9b9cf38f0021a31b0e7ac7ba
8 changes: 4 additions & 4 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ where
///
/// The windows are all distinct views of size `window_size`
/// that fit into the array's shape.
///
///
/// The stride is ordered by the outermost axis.<br>
/// Hence, a (x₀, x₁, ..., xₙ) stride will be applied to
/// (A₀, A₁, ..., Aₙ) where Aₓ stands for `Axis(x)`.
Expand All @@ -1441,7 +1441,7 @@ where
///
/// The produced element is an `ArrayView<A, D>` with exactly the dimension
/// `window_size`.
///
///
/// Note that passing a stride of only ones is similar to
/// calling [`ArrayBase::windows()`].
///
Expand Down Expand Up @@ -2374,7 +2374,7 @@ where
A: Clone,
S2: Data<Elem = A>,
{
self.zip_mut_with(rhs, |x, y| *x = y.clone());
self.zip_mut_with(rhs, |x, y| x.clone_from(y));
}

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

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