Skip to content

Commit

Permalink
library: use copied instead of manual map
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Nov 3, 2023
1 parent a026bd4 commit e6779d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ where

#[inline]
fn try_from(slice: &[T]) -> Result<[T; N], TryFromSliceError> {
<&Self>::try_from(slice).map(|r| *r)
<&Self>::try_from(slice).copied()
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/iter/adapters/copied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ where
T: Copy,
{
default fn spec_next_chunk(&mut self) -> Result<[T; N], array::IntoIter<T, N>> {
array::iter_next_chunk(&mut self.map(|e| *e))
array::iter_next_chunk(&mut self.copied())
}
}

Expand Down

0 comments on commit e6779d9

Please sign in to comment.