Want to get multiple mutable slices from a vector?
#Rustlang will complain about:
let range_a = &mut vec[0..10];
let range_b = &mut vec[10..];
Because the first mutable borrow is for the entire `Vec`. Rust doesn't understand that the ranges are non-overlapping. The solution is to use `.split_at_mut()`:
let (range_a, range_b) = vec.split_at_mut(10);
If you want to completely split a Vec into sub-ranges, see `vec.chunks_mut()`.
Try it: https://is.gd/Q5c8vD