Challenge 57

Can you predict what will be printed in the code shown below?

// Rust Bytes Issue 66

fn main() {
    let mut vec = vec![1, 2, 3, 4, 5, 6];
    let drained: Vec<i32> = vec.drain(1..3).collect();
    println!("Result: {:?}", vec);
}

Solution

Click to Show/Hide Solution