Strings In Depth13 / 18
Up next

split yields borrows

fn main() {
    let csv = "a,b,c";
    // each piece borrows the original buffer, no copies
    let parts: Vec<&str> = csv.split(',').collect();
    println!("{:?}", parts);
}
What you're solving

pieces are &str into the original