Why does calling filter on a vector not remove elements from the vector?
问题 I am writing a small program that finds a winner of a marathon. Everything seems logical until I try to filter the vector for runners that are late for some amount of time. The vector remains same after the filter function, and if use iter_mut() it states type errors. fn main() { let mut input_line = String::new(); std::io::stdin().read_line(&mut input_line); let n = input_line.trim().parse::<u8>().unwrap(); let mut v = Vec::with_capacity(n as usize); for _ in 0..n { let mut input_line =