Skip to content

Commit 46c386c

Browse files
committed
chore: clippy
1 parent dd1e885 commit 46c386c

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

iroh-willow/src/engine/actor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl<S: Storage> Actor<S> {
550550
self.tasks.spawn_local(async move {
551551
let mut stream = store.entries().subscribe_area(namespace, area, params);
552552
while let Some(event) = stream.next().await {
553-
if let Err(_) = sender.send(event).await {
553+
if sender.send(event).await.is_err() {
554554
break;
555555
}
556556
}
@@ -571,7 +571,7 @@ impl<S: Storage> Actor<S> {
571571
.entries()
572572
.resume_subscription(progress_id, namespace, area, params);
573573
while let Some(event) = stream.next().await {
574-
if let Err(_) = sender.send(event).await {
574+
if sender.send(event).await.is_err() {
575575
break;
576576
}
577577
}

iroh-willow/src/store/memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl traits::EntryStorage for Rc<RefCell<EntryStore>> {
335335
params,
336336
namespace,
337337
progress_id,
338-
store: Rc::downgrade(&self),
338+
store: Rc::downgrade(self),
339339
}
340340
}
341341

@@ -351,7 +351,7 @@ impl traits::EntryStorage for Rc<RefCell<EntryStore>> {
351351
params,
352352
progress_id,
353353
namespace,
354-
store: Rc::downgrade(&self),
354+
store: Rc::downgrade(self),
355355
}
356356
}
357357
}

iroh-willow/src/store/traits.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,9 @@ impl StoreEvent {
255255
&& params.includes_origin(origin)
256256
}
257257
StoreEvent::Pruned(_, PruneEvent { pruned, by: _ }) => {
258-
if !params.ingest_only
258+
!params.ingest_only
259259
&& *pruned.entry().namespace_id() == namespace_id
260260
&& area.includes_entry(pruned.entry())
261-
{
262-
true
263-
} else {
264-
false
265-
}
266261
}
267262
}
268263
}
@@ -328,11 +323,7 @@ impl SubscribeParams {
328323
}
329324

330325
pub fn includes_entry(&self, entry: &Entry) -> bool {
331-
if self.ignore_empty_payloads && entry.payload_length() == 0 {
332-
false
333-
} else {
334-
true
335-
}
326+
!(self.ignore_empty_payloads && entry.payload_length() == 0)
336327
}
337328

338329
pub fn includes_origin(&self, origin: &EntryOrigin) -> bool {

0 commit comments

Comments
 (0)