From 79cab93d49f03f480df03287cdf645dc07bc6c93 Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Wed, 23 Dec 2020 14:07:09 +1100 Subject: [PATCH] Use count instead of collect and len Clippy emits warning: warning: avoid using `collect()` when not needed As suggested by clippy just use `count` directly on the iterator instead of `collect` followed by `len`. --- src/wallet/tx_builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/tx_builder.rs b/src/wallet/tx_builder.rs index 35c7d073..9a9b8d2e 100644 --- a/src/wallet/tx_builder.rs +++ b/src/wallet/tx_builder.rs @@ -736,9 +736,9 @@ mod test { let filtered = get_test_utxos() .into_iter() .filter(|u| change_spend_policy.is_satisfied_by(u)) - .collect::>(); + .count(); - assert_eq!(filtered.len(), 2); + assert_eq!(filtered, 2); } #[test]