Skip to content

Commit

Permalink
fixup: Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Aug 11, 2023
1 parent 5e7fa4b commit 0be6170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions dht-cache/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,11 @@ impl PeersState {

if desync {
CacheState::Desynced {
is_leader: self
.list
.values()
.find(|data| {
data.cache_hash == hash
&& data.peer_id.as_str() < peer_id
&& data.publication_timestamp > cur_ts
})
.is_none(),
is_leader: !self.list.values().any(|data| {
data.cache_hash == hash
&& data.peer_id.as_str() < peer_id
&& data.publication_timestamp > cur_ts
}),
}
} else {
CacheState::Synced
Expand Down
4 changes: 2 additions & 2 deletions dht-cache/src/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn dht_channel(
JoinHandle<Swarm<DomoBehaviour>>,
) {
let (cmd_send, mut cmd_recv) = mpsc::unbounded_channel();
let (mut ev_send, ev_recv) = mpsc::unbounded_channel();
let (ev_send, ev_recv) = mpsc::unbounded_channel();

let handle = tokio::task::spawn(async move {
loop {
Expand All @@ -164,7 +164,7 @@ pub fn dht_channel(
}
}
ev = swarm.select_next_some() => {
if handle_swarm_event(&mut swarm, ev, &mut ev_send).is_err() {
if handle_swarm_event(&mut swarm, ev, &ev_send).is_err() {
log::debug!("Exiting ev");
return swarm
}
Expand Down

0 comments on commit 0be6170

Please sign in to comment.