Skip to content

Commit

Permalink
nit reorder impl (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Laine authored Mar 25, 2024
1 parent 1412662 commit 061d55c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions firewood/src/shale/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ struct InMemLinearStoreView {
mem: InMemLinearStore,
}

impl LinearStoreView for InMemLinearStoreView {
type DerefReturn = Vec<u8>;

fn as_deref(&self) -> Self::DerefReturn {
#[allow(clippy::indexing_slicing, clippy::unwrap_used)]
self.mem.space.read().unwrap()[self.offset..self.offset + self.length].to_vec()
}
}

struct InMemLinearStoreShared(InMemLinearStore);

impl Deref for InMemLinearStoreShared {
Expand All @@ -111,15 +120,6 @@ impl DerefMut for InMemLinearStoreShared {
}
}

impl LinearStoreView for InMemLinearStoreView {
type DerefReturn = Vec<u8>;

fn as_deref(&self) -> Self::DerefReturn {
#[allow(clippy::indexing_slicing, clippy::unwrap_used)]
self.mem.space.read().unwrap()[self.offset..self.offset + self.length].to_vec()
}
}

#[cfg(test)]
#[allow(clippy::indexing_slicing, clippy::unwrap_used)]
mod tests {
Expand Down

0 comments on commit 061d55c

Please sign in to comment.