I'm trying to eliminate duplicates in a sorted vector with the dedup function, but it returns empty.
Here's my code:
fn main() {
let mut input = vec![1, 1, 2, 3, 3];
remove_dup(&mut input);
}
fn remove_dup(input: &mut Vec<u32>) {
let result = input.dedup();
println!("Result: {:?}", result);
}
Here's the output:
Result: ()