Skip to content

Commit 0be6170

Browse files
committed
fixup: Clippy lints
1 parent 5e7fa4b commit 0be6170

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

dht-cache/src/cache.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,11 @@ impl PeersState {
129129

130130
if desync {
131131
CacheState::Desynced {
132-
is_leader: self
133-
.list
134-
.values()
135-
.find(|data| {
136-
data.cache_hash == hash
137-
&& data.peer_id.as_str() < peer_id
138-
&& data.publication_timestamp > cur_ts
139-
})
140-
.is_none(),
132+
is_leader: !self.list.values().any(|data| {
133+
data.cache_hash == hash
134+
&& data.peer_id.as_str() < peer_id
135+
&& data.publication_timestamp > cur_ts
136+
}),
141137
}
142138
} else {
143139
CacheState::Synced

dht-cache/src/dht.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub fn dht_channel(
151151
JoinHandle<Swarm<DomoBehaviour>>,
152152
) {
153153
let (cmd_send, mut cmd_recv) = mpsc::unbounded_channel();
154-
let (mut ev_send, ev_recv) = mpsc::unbounded_channel();
154+
let (ev_send, ev_recv) = mpsc::unbounded_channel();
155155

156156
let handle = tokio::task::spawn(async move {
157157
loop {
@@ -164,7 +164,7 @@ pub fn dht_channel(
164164
}
165165
}
166166
ev = swarm.select_next_some() => {
167-
if handle_swarm_event(&mut swarm, ev, &mut ev_send).is_err() {
167+
if handle_swarm_event(&mut swarm, ev, &ev_send).is_err() {
168168
log::debug!("Exiting ev");
169169
return swarm
170170
}

0 commit comments

Comments
 (0)