library: use copied instead of manual map

This commit is contained in:
DaniPopes 2023-11-03 17:11:39 +01:00
parent a026bd49e1
commit e6779d98ee
No known key found for this signature in database
GPG Key ID: 0F09640DDB7AC692
2 changed files with 2 additions and 2 deletions

View File

@ -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()
}
}

View File

@ -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())
}
}