6 ms·
Both are valid Rust. The former means "I don't own var, but I can change it", while the later means "I own a reference that I can change where it points, but I
by estebank 4y ago
Both are valid Rust. The former means "I don't own var, but I can change it", while the later means "I own a reference that I can change where it points, but I can't change the pointed value."
An argument could be made that it shouldn't have been '&mut' and instead be something like '&exclusive'.