Skip to content

Commit e6779d9

Browse files
committed
library: use copied instead of manual map
1 parent a026bd4 commit e6779d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/core/src/array/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ where
206206

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

library/core/src/iter/adapters/copied.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ where
193193
T: Copy,
194194
{
195195
default fn spec_next_chunk(&mut self) -> Result<[T; N], array::IntoIter<T, N>> {
196-
array::iter_next_chunk(&mut self.map(|e| *e))
196+
array::iter_next_chunk(&mut self.copied())
197197
}
198198
}
199199

0 commit comments

Comments
 (0)