Closed
Description
The following unsafe unchecked indexing / slicing methods don't refer to the safe alternatives at all, misleading newbies into thinking that they are the preferred way of performing that operation. There should be a big disclaimer stating what their checked counterparts are and that they are preferred.
str::slice_unchecked
/str::slice_mut_unchecked
[T]::get_unchecked
/[T]::get_unchecked_mut
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Mark-Simulacrum commentedon May 23, 2017
cc @rust-lang/docs, this feels like an E-easy issue to me, tagging as such -- we should add the links to the unchecked method documentations pointing to safe indexing (
get
, probably, where applicable as well as noting indexing with theIndex
trait). Does that sound good?GuillaumeGomez commentedon May 23, 2017
@Mark-Simulacrum: Yep, all good.
citizen428 commentedon May 25, 2017
If no-one picks it up until then I'll try to get this done over the weekend.
GuillaumeGomez commentedon May 25, 2017
@citizen428: Sure, go ahead.
Rollup merge of rust-lang#42236 - citizen428:docs/unchecked-indexing-…
Rollup merge of rust-lang#42236 - citizen428:docs/unchecked-indexing-…
citizen428 commentedon Jun 5, 2017
This has been merged, so the issue should be closed.