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 2020-12-23 14:07:09 +11:00
parent 2afc9faa08
commit 79cab93d49
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607

View File

@ -736,9 +736,9 @@ mod test {
let filtered = get_test_utxos() let filtered = get_test_utxos()
.into_iter() .into_iter()
.filter(|u| change_spend_policy.is_satisfied_by(u)) .filter(|u| change_spend_policy.is_satisfied_by(u))
.collect::<Vec<_>>(); .count();
assert_eq!(filtered.len(), 2); assert_eq!(filtered, 2);
} }
#[test] #[test]