Skip to content

Commit

Permalink
fix: remove #[allow(unused)]
Browse files Browse the repository at this point in the history
  • Loading branch information
aatifsyed committed Jun 28, 2023
1 parent 25a7f02 commit a045c87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/car_backed_blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ where
trace!("fetching from disk");
reader.seek(SeekFrom::Start(*offset))?;
let mut data = vec![0; usize::try_from(*length).unwrap()];
reader.read_exact(&mut data);
reader.read_exact(&mut data)?;
Ok(Some(data))
}
(None, Occupied(cached)) => {
Expand All @@ -190,10 +190,7 @@ where
#[tracing::instrument(level = "trace", skip(self, block))]
fn put_keyed(&self, k: &Cid, block: &[u8]) -> anyhow::Result<()> {
let CarBackedBlockstoreInner {
reader,
write_cache,
index,
..
write_cache, index, ..
} = &mut *self.inner.lock();
match (index.get(k), write_cache.entry(*k)) {
(None, Occupied(already)) => match already.get() == block {
Expand Down Expand Up @@ -281,7 +278,7 @@ fn read_u32_or_eof(mut reader: impl Read) -> Option<io::Result<u32>> {
match reader.read(&mut byte) {
Ok(0) => None,
Ok(1) => match read_u32(byte.chain(reader)) {
Ok(u) => (Some(Ok(u))),
Ok(u) => Some(Ok(u)),
Err(Decode(e)) => Some(Err(io::Error::new(InvalidData, e))),
Err(Io(e)) => Some(Err(e)),
Err(other) => Some(Err(io::Error::new(Other, other))),
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ cfg_if::cfg_if! {
mod auth;
mod beacon;
mod blocks;
#[allow(unused)] // TODO(lemmih): actually use this
mod car_backed_blockstore;
mod chain;
mod chain_sync;
Expand Down

0 comments on commit a045c87

Please sign in to comment.