From ca7590b9bdc6e095290b2de7a5f8d6892c0d9d00 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 10 May 2024 23:36:14 -0700 Subject: [PATCH] blake2: fixup rustc 1.78 warnings Starting 1.78, rust will report the `as_mut_bytes` method is dead code. I believe rustc is correct. --- blake2/src/as_bytes.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/blake2/src/as_bytes.rs b/blake2/src/as_bytes.rs index c77fcd6df..8834e6a78 100644 --- a/blake2/src/as_bytes.rs +++ b/blake2/src/as_bytes.rs @@ -13,7 +13,6 @@ pub unsafe trait Safe {} pub trait AsBytes { fn as_bytes(&self) -> &[u8]; - fn as_mut_bytes(&mut self) -> &mut [u8]; } impl AsBytes for [T] { @@ -21,11 +20,6 @@ impl AsBytes for [T] { fn as_bytes(&self) -> &[u8] { unsafe { slice::from_raw_parts(self.as_ptr() as *const u8, mem::size_of_val(self)) } } - - #[inline] - fn as_mut_bytes(&mut self) -> &mut [u8] { - unsafe { slice::from_raw_parts_mut(self.as_mut_ptr() as *mut u8, mem::size_of_val(self)) } - } } unsafe impl Safe for u8 {}