From 8b97e1eba1e97302bacb8faff789d2d77e04c6b4 Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Mon, 30 Oct 2023 22:09:51 -0700 Subject: [PATCH] Remove unused U64Field implementation for Storable (#334) Signed-off-by: Richard Pringle Co-authored-by: Richard Pringle --- shale/src/compact.rs | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/shale/src/compact.rs b/shale/src/compact.rs index 65937a0d8..098f72864 100644 --- a/shale/src/compact.rs +++ b/shale/src/compact.rs @@ -213,47 +213,6 @@ impl Storable for CompactSpaceHeader { } } -#[derive(Debug)] -struct U64Field(u64); - -impl U64Field { - const MSIZE: u64 = 8; -} - -impl Storable for U64Field { - fn hydrate(addr: usize, mem: &U) -> Result { - let raw = mem - .get_view(addr, Self::MSIZE) - .ok_or(ShaleError::InvalidCacheView { - offset: addr, - size: Self::MSIZE, - })?; - Ok(Self(u64::from_le_bytes(raw.as_deref().try_into().unwrap()))) - } - - fn dehydrated_len(&self) -> u64 { - Self::MSIZE - } - - fn dehydrate(&self, to: &mut [u8]) -> Result<(), ShaleError> { - Cursor::new(to).write_all(&self.0.to_le_bytes())?; - Ok(()) - } -} - -impl std::ops::Deref for U64Field { - type Target = u64; - fn deref(&self) -> &u64 { - &self.0 - } -} - -impl std::ops::DerefMut for U64Field { - fn deref_mut(&mut self) -> &mut u64 { - &mut self.0 - } -} - #[derive(Debug)] struct CompactSpaceInner { meta_space: Arc,