Skip to content

Commit b527634

Browse files
authored
Rollup merge of rust-lang#117549 - DaniPopes:more-copied, r=b-naber
Use `copied` instead of manual `map`
2 parents 1ad3940 + 59174fb commit b527634

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/src/array/mod.rs

Lines changed: 1 addition & 1 deletion
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

core/src/iter/adapters/copied.rs

Lines changed: 1 addition & 1 deletion
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)