fix new cargo clippy lints

This commit is contained in:
Alex Auvolat
2026-04-23 22:21:15 +02:00
parent 1cdaccbc3d
commit d977ca4a24
4 changed files with 8 additions and 16 deletions
+4 -6
View File
@@ -473,12 +473,10 @@ where
)))); ))));
} }
} }
Poll::Ready(None) => { Poll::Ready(None) if !self.length.contains(&self.read) => {
if !self.length.contains(&self.read) { return Poll::Ready(Some(Err(Error::bad_request(
return Poll::Ready(Some(Err(Error::bad_request( "File size does not match policy",
"File size does not match policy", ))));
))));
}
} }
_ => {} _ => {}
} }
+1 -1
View File
@@ -648,7 +648,7 @@ impl BlockStoreIterator {
let mut cum_cap = 0; let mut cum_cap = 0;
let mut todo = vec![]; let mut todo = vec![];
for (dir, cap) in data_layout.data_dirs.iter().zip(dir_cap.into_iter()) { for (dir, cap) in data_layout.data_dirs.iter().zip(dir_cap) {
let progress_min = (cum_cap * PROGRESS_FP) / sum_cap; let progress_min = (cum_cap * PROGRESS_FP) / sum_cap;
let progress_max = ((cum_cap + cap as u64) * PROGRESS_FP) / sum_cap; let progress_max = ((cum_cap + cap as u64) * PROGRESS_FP) / sum_cap;
cum_cap += cap as u64; cum_cap += cap as u64;
+2 -4
View File
@@ -313,10 +313,8 @@ impl PeeringManager {
to_ping.push(*id); to_ping.push(*id);
} }
} }
PeerConnState::Waiting(_, t) => { PeerConnState::Waiting(_, t) if Instant::now() >= t => {
if Instant::now() >= t { to_retry.push(*id);
to_retry.push(*id);
}
} }
_ => (), _ => (),
} }
+1 -5
View File
@@ -241,11 +241,7 @@ impl RpcHelper {
) )
.with_context(Context::current_with_span(span)) .with_context(Context::current_with_span(span))
.await; .await;
Ok(to Ok(to.iter().cloned().zip(resps).collect::<Vec<_>>())
.iter()
.cloned()
.zip(resps.into_iter())
.collect::<Vec<_>>())
} }
pub async fn broadcast<M, N, H, S>( pub async fn broadcast<M, N, H, S>(