What's up with vec.push?
Does anyone know why this compiles?
let mut v = vec![&10];
v.push(&v[0]);
But this doesn't
Vec::push(&mut v, &v[0]);
v.push method borrows &mut self just as the Vec::push associated function borrows v
Does anyone know why this compiles?
let mut v = vec![&10];
v.push(&v[0]);
But this doesn't
Vec::push(&mut v, &v[0]);
v.push method borrows &mut self just as the Vec::push associated function borrows v