From de811bea309774b9c48257b3727634d98598cbe5 Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Thu, 6 May 2021 14:32:08 +1000 Subject: [PATCH] Use !any() instead of find()...is_none() Clippy emits: warning: called `is_none()` after searching an `Iterator` with `find` As suggested, use the construct: `!foo.iter().any(...)` --- src/wallet/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index b4b92899..11b58849 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -1166,11 +1166,11 @@ where // must_spend <- manually selected utxos // may_spend <- all other available utxos let mut may_spend = self.get_available_utxos()?; + may_spend.retain(|may_spend| { - manually_selected + !manually_selected .iter() - .find(|manually_selected| manually_selected.utxo.outpoint() == may_spend.0.outpoint) - .is_none() + .any(|manually_selected| manually_selected.utxo.outpoint() == may_spend.0.outpoint) }); let mut must_spend = manually_selected;