aboutsummaryrefslogtreecommitdiff
path: root/src/block
diff options
context:
space:
mode:
Diffstat (limited to 'src/block')
-rw-r--r--src/block/Cargo.toml2
-rw-r--r--src/block/layout.rs3
-rw-r--r--src/block/manager.rs2
-rw-r--r--src/block/resync.rs6
4 files changed, 5 insertions, 8 deletions
diff --git a/src/block/Cargo.toml b/src/block/Cargo.toml
index 1af4d7f5..3358a3e7 100644
--- a/src/block/Cargo.toml
+++ b/src/block/Cargo.toml
@@ -34,10 +34,8 @@ async-compression.workspace = true
zstd.workspace = true
serde.workspace = true
-serde_bytes.workspace = true
futures.workspace = true
-futures-util.workspace = true
tokio.workspace = true
tokio-util.workspace = true
diff --git a/src/block/layout.rs b/src/block/layout.rs
index e78f3f08..00e3debb 100644
--- a/src/block/layout.rs
+++ b/src/block/layout.rs
@@ -279,7 +279,8 @@ impl DataLayout {
u16::from_be_bytes([
hash.as_slice()[HASH_DRIVE_BYTES.0],
hash.as_slice()[HASH_DRIVE_BYTES.1],
- ]) as usize % DRIVE_NPART
+ ]) as usize
+ % DRIVE_NPART
}
fn block_dir_from(&self, hash: &Hash, dir: &PathBuf) -> PathBuf {
diff --git a/src/block/manager.rs b/src/block/manager.rs
index 40b177a2..537e1fc1 100644
--- a/src/block/manager.rs
+++ b/src/block/manager.rs
@@ -4,7 +4,6 @@ use std::sync::Arc;
use std::time::Duration;
use arc_swap::{ArcSwap, ArcSwapOption};
-use async_trait::async_trait;
use bytes::Bytes;
use rand::prelude::*;
use serde::{Deserialize, Serialize};
@@ -688,7 +687,6 @@ impl BlockManager {
}
}
-#[async_trait]
impl StreamingEndpointHandler<BlockRpc> for BlockManager {
async fn handle(self: &Arc<Self>, mut message: Req<BlockRpc>, _from: NodeID) -> Resp<BlockRpc> {
match message.msg() {
diff --git a/src/block/resync.rs b/src/block/resync.rs
index ab4604ad..947c68de 100644
--- a/src/block/resync.rs
+++ b/src/block/resync.rs
@@ -105,7 +105,7 @@ impl BlockResyncManager {
}
}
- /// Get lenght of resync queue
+ /// Get length of resync queue
pub fn queue_len(&self) -> Result<usize, Error> {
Ok(self.queue.len()?)
}
@@ -185,10 +185,10 @@ impl BlockResyncManager {
//
// - resync.errors: a tree that indicates for each block
// if the last resync resulted in an error, and if so,
- // the following two informations (see the ErrorCounter struct):
+ // the following two information (see the ErrorCounter struct):
// - how many consecutive resync errors for this block?
// - when was the last try?
- // These two informations are used to implement an
+ // These two information are used to implement an
// exponential backoff retry strategy.
// The key in this tree is the 32-byte hash of the block,
// and the value is the encoded ErrorCounter value.