about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLinda_pp <rhysd@users.noreply.github.com>2021-11-21 11:01:31 +0900
committerGitHub <noreply@github.com>2021-11-21 11:01:31 +0900
commitac083c6b45bd3fbe0dc24ab57e2dd9d55f14d472 (patch)
tree44ad1c1efe9a182b107fe4f971377109be13be11
parent66e0523d09b01616e85565b35f97c99cc0bb2136 (diff)
downloadrust-ac083c6b45bd3fbe0dc24ab57e2dd9d55f14d472.tar.gz
rust-ac083c6b45bd3fbe0dc24ab57e2dd9d55f14d472.zip
Reborrow mut slice instead of converting it with `as_ref`
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
-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 700fa7f4e2d..181f8b408e6 100644
--- a/library/core/src/array/mod.rs
+++ b/library/core/src/array/mod.rs
@@ -184,7 +184,7 @@ where
     type Error = TryFromSliceError;
 
     fn try_from(slice: &mut [T]) -> Result<[T; N], TryFromSliceError> {
-        <Self>::try_from(slice.as_ref())
+        <Self>::try_from(&*slice)
     }
 }