mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Reborrow mut slice instead of converting it with as_ref
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
This commit is contained in:
@@ -184,7 +184,7 @@ fn borrow_mut(&mut self) -> &mut [T] {
|
||||
type Error = TryFromSliceError;
|
||||
|
||||
fn try_from(slice: &mut [T]) -> Result<[T; N], TryFromSliceError> {
|
||||
<Self>::try_from(slice.as_ref())
|
||||
<Self>::try_from(&*slice)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user