3 ms·
For someone looking for an example of this, here's a SO post: https://stackoverflow.com/questions/74592882/extend-a-string-with-another-string-within-the-same-v
by bobbylarrybobby 4y ago
For someone looking for an example of this, here's a SO post: https://stackoverflow.com/questions/74592882/extend-a-string-with-another-string-within-the-same-vector-rust https://stackoverflow.com/questions/74592882/extend-a-string...
Tl;dr Rust can't distinguish between a `Vec` whose length is mutable (which might need to reallocate) and one whose elements are mutable (which can provide mutable references to its elements but will never have to move them), so it prevents mutation in a case where it would be safe.
- zozbot234 4y agoIsn't the latter just a mutable slice?