#[warn(clippy, needless_collect)] #[allow(unused_variables, iter_cloned_collect)] fn main() { let sample = [1; 5]; let len = sample.iter().collect::>().len(); if sample.iter().collect::>().is_empty() { // Empty } sample.iter().cloned().collect::>().contains(&1); }