-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
Index and IndexMut are definitely lacking in explanations.
For starters, nothing says what does v[x]
do exactly. (spoilers : it's sugar for *v.index(x)
and *v.index_mut(x)
and not v.index(x)
; that allows things like v[x] = 5
).
Index<usize>
is implemented for lots of trivial types (str, String, Vec, ...), but nothing is said about Index<Range...>
, and I think it would be worth showing some examples.
I'm opening this, but I'm planning to open a PR next week fixing this, unless someone else is up for it of course.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.