### What it does Guides users to use `Vec::retain()` over various permutations of `into_iter().filter().collect()` if used to assign over the original vector. ### Lint Name vec_retain ### Category style, complexity, perf, pedantic ### Advantage Conciseness, readability, and reuses existing memory (in the `.iter()...copied()` case) ### Drawbacks Difficulty parsing out particularly complex chains of function calls. ### Example ```rust let mut my_vec = vec![0, 1, 2, 3, 4, 5]; my_vec = my_vec.into_iter().filter(|x| x % 2 == 0).collect(); // Or my_vec = my_vec.iter().filter(|&x| x % 2 == 0).copied().collect(); ``` Could be written as: ```rust let mut my_vec = vec![0, 1, 2, 3, 4, 5]; my_vec.retain(|x| x % 2 == 0); ``` <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"kyoto7250"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->