Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam committed Sep 11, 2023
1 parent 8c07981 commit 6a26fb7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/network/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Client {
branches_to_reload = reload_index_rx.changed() => {
if let Ok(branches_to_reload) = branches_to_reload {
for branch_to_reload in &branches_to_reload {
self.reload_index(&branch_to_reload);
self.reload_index(branch_to_reload);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/network/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async fn transfer_blocks_between_two_replicas_case(block_count: usize, rng_seed:
}

// Then wait until replica B receives and writes it too.
for (id, _block) in snapshot.blocks() {
for id in snapshot.blocks().keys() {
wait_until_block_exists(&b_vault, id).await;
}
};
Expand Down
6 changes: 4 additions & 2 deletions lib/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ pub(crate) mod broadcast_hash_set {
}
}

type ReceiverState<T> = (uninitialized_watch::Sender<()>, HashSet<T>);

struct Shared<T> {
id_generator: AtomicUsize,
receivers: Mutex<HashMap<usize, (uninitialized_watch::Sender<()>, HashSet<T>)>>,
receivers: Mutex<HashMap<usize, ReceiverState<T>>>,
}

pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
Expand Down Expand Up @@ -358,7 +360,7 @@ pub(crate) mod stream {
loop {
match this.inner.as_mut().poll_next(cx) {
Poll::Ready(Some(item)) => {
let is_ready = Self::is_ready(&this.ready, &item);
let is_ready = Self::is_ready(this.ready, &item);

match this.delays.entry(item.clone()) {
hash_map::Entry::Occupied(mut entry) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ fn redownload_expired_blocks() {
let test_content = Arc::new(common::random_content(2 * 1024 * 1024));

async fn wait_for_block_count(repo: &Repository, block_count: u64) {
common::eventually(&repo, || {
common::eventually(repo, || {
async { repo.count_blocks().await.unwrap() == block_count }
.instrument(tracing::Span::current())
})
Expand Down

0 comments on commit 6a26fb7

Please sign in to comment.