Spot the bug in vector growth

from Borrowing rules
Rust 1.98 intermediate 4 min 1 issue to find

Find why this function cannot append a copy and then log the original reference.

Rust
fn duplicate_first(labels: &mut Vec<String>) {
    let first = &labels[0];
    labels.push(first.clone());
    println!("original: {first}");
}
Open in playground
Report an error