From 3fcfa9606090ee1d233da20c1d8114ae69a9c796 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Sat, 11 May 2024 16:39:32 +0000 Subject: [PATCH] blake2: fixup rustc 1.78 warnings (#580) Starting 1.78, rust will report the `as_mut_bytes` method is dead code. --- 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 {}