1 use std::collections::{BTreeSet, HashMap, HashSet};
3 #[warn(clippy::needless_collect)]
4 #[allow(unused_variables, clippy::iter_cloned_collect)]
7 let len = sample.iter().collect::<Vec<_>>().len();
8 if sample.iter().collect::<Vec<_>>().is_empty() {
11 sample.iter().cloned().collect::<Vec<_>>().contains(&1);
12 sample.iter().map(|x| (x, x)).collect::<HashMap<_, _>>().len();
13 // Notice the `HashSet`--this should not be linted
14 sample.iter().collect::<HashSet<_>>().len();
15 // Neither should this
16 sample.iter().collect::<BTreeSet<_>>().len();