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`.
This commit is contained in:
Tobin Harding committed 2021-02-24 13:30:47 +11:00
1 parent 2afc9faa08
commit 79cab93d49
1 file changed
+2 -2
+2 -2
View File
@@ -736,9 +736,9 @@ mod test {
let filtered = get_test_utxos()
.into_iter()
.filter(|u| change_spend_policy.is_satisfied_by(u))
.collect::<Vec<_>>();
.count();
assert_eq!(filtered.len(), 2);
assert_eq!(filtered, 2);
}
#[test]