diff options
| author | DaniPopes <57450786+DaniPopes@users.noreply.github.com> | 2023-11-03 17:11:39 +0100 |
|---|---|---|
| committer | DaniPopes <57450786+DaniPopes@users.noreply.github.com> | 2023-11-03 17:18:45 +0100 |
| commit | e6779d98eef749832c5626c94c3391aa057a941b (patch) | |
| tree | b302bce6173a8af80d93bfd39c0f3e4a83635f38 | |
| parent | a026bd49e143d10187f22dce621fff31211e1028 (diff) | |
library: use `copied` instead of manual `map`
| -rw-r--r-- | library/core/src/array/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/iter/adapters/copied.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index ebd4a8c05fe..4c48b199f0f 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -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() } } diff --git a/library/core/src/iter/adapters/copied.rs b/library/core/src/iter/adapters/copied.rs index 8f6b2904eae..7a2c9d839b7 100644 --- a/library/core/src/iter/adapters/copied.rs +++ b/library/core/src/iter/adapters/copied.rs @@ -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()) } } |
