Closed
Description
Mutably indexing a Vec
(and probably lots of other collections) is weird.
On one hand, you can dereference a mutable pointer:
*vec.get_mut(index) = value;
Which is ugly and inconsistent with immutable indexing (vec[index]
)
With the new slicing syntax you can do this:
vec[mut][index] = value;
Which is arguably nicer. But wouldn't something like:
vec[mut index] = value;
Be even better and more consistent?
Metadata
Metadata
Assignees
Labels
No labels