about summary refs log tree commit diff
path: root/library/core/src/array
diff options
context:
space:
mode:
authorDaniPopes <57450786+DaniPopes@users.noreply.github.com>2023-11-03 17:11:39 +0100
committerDaniPopes <57450786+DaniPopes@users.noreply.github.com>2023-11-03 17:18:45 +0100
commite6779d98eef749832c5626c94c3391aa057a941b (patch)
treeb302bce6173a8af80d93bfd39c0f3e4a83635f38 /library/core/src/array
parenta026bd49e143d10187f22dce621fff31211e1028 (diff)
downloadrust-e6779d98eef749832c5626c94c3391aa057a941b.tar.gz
rust-e6779d98eef749832c5626c94c3391aa057a941b.zip
library: use `copied` instead of manual `map`
Diffstat (limited to 'library/core/src/array')
-rw-r--r--library/core/src/array/mod.rs2
1 files changed, 1 insertions, 1 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()
     }
 }