-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Milestone
Description
The current Index
isn't great because you have to use &self
and return &T
or T
(via clone) for a map/vector type.
I think it would be best to split it into Index
(with &self
), IndexMut
(with &mut self
) and IndexAssign
(&mut self
, inserting a value).
I'm unsure about the syntax. It would be nice to make it uniform with vector syntax and have &a["foo"]
call Index
for &T
, etc.
Metadata
Metadata
Assignees
Labels
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.