Skip to content

Commit

Permalink
Fix clippy warnings: use Iterator::copied method
Browse files Browse the repository at this point in the history
  • Loading branch information
daniil-berg committed Apr 20, 2024
1 parent 8ed45da commit d1ed0a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tensor_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl<C: TensorComponent> TensorBase for Array1<C> {
fn iter_axis<T>(&self, axis: usize) -> impl Iterator<Item = T>
where T: TensorBase<Component = Self::Component, Dim = <Self::Dim as HasLowerDimension>::Lower> {
Array1::<C>::axis_iter(self, Axis(axis))
.map(|subview| T::from_iter(subview.iter().map(|c| *c), subview.dim()))
.map(|subview| T::from_iter(subview.iter().copied(), ()))
}

fn sum_axis<T>(&self, _axis: usize) -> T
Expand Down Expand Up @@ -253,7 +253,7 @@ impl<C: TensorComponent> TensorBase for Array2<C> {
fn iter_axis<T>(&self, axis: usize) -> impl Iterator<Item = T>
where T: TensorBase<Component = Self::Component, Dim = <Self::Dim as HasLowerDimension>::Lower> {
Array2::<C>::axis_iter(self, Axis(axis))
.map(|subview| T::from_iter(subview.iter().map(|c| *c), subview.dim()))
.map(|subview| T::from_iter(subview.iter().copied(), subview.dim()))
}

fn sum_axis<T>(&self, axis: usize) -> T
Expand Down Expand Up @@ -361,7 +361,7 @@ impl<C: TensorComponent> TensorBase for Array3<C> {
fn iter_axis<T>(&self, axis: usize) -> impl Iterator<Item = T>
where T: TensorBase<Component = Self::Component, Dim = <Self::Dim as HasLowerDimension>::Lower> {
Array3::<C>::axis_iter(self, Axis(axis))
.map(|subview| T::from_iter(subview.iter().map(|c| *c), subview.dim()))
.map(|subview| T::from_iter(subview.iter().copied(), subview.dim()))
}

fn sum_axis<T>(&self, axis: usize) -> T
Expand Down

0 comments on commit d1ed0a2

Please sign in to comment.