3 #![allow(unused, clippy::suspicious_map)]
5 use std::collections::{BTreeSet, HashMap, HashSet};
7 #[warn(clippy::needless_collect)]
8 #[allow(unused_variables, clippy::iter_cloned_collect)]
11 let len = sample.iter().count();
12 if sample.iter().next().is_none() {
15 sample.iter().cloned().any(|x| x == 1);
16 sample.iter().map(|x| (x, x)).count();
17 // Notice the `HashSet`--this should not be linted
18 sample.iter().collect::<HashSet<_>>().len();
19 // Neither should this
20 sample.iter().collect::<BTreeSet<_>>().len();