Values & References10 / 18
Up next

Slices are borrows

fn main() {
    let v = vec![10, 20, 30, 40];
    // a slice borrows a contiguous window of the Vec
    let mid = &v[1..3];
    println!("{:?}", mid);
}
What you're solving

&v[a..b] is a window, not a copy