Skip to content

Commit

Permalink
Rollup merge of rust-lang#65887 - lzutao:doc-vec-get, r=rkruppe
Browse files Browse the repository at this point in the history
doc: mention `get(_mut)` in Vec
  • Loading branch information
JohnTitor authored Oct 28, 2019
2 parents e1c36fd + e2c450b commit ea3548b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ use crate::raw_vec::RawVec;
/// println!("{}", v[6]); // it will panic!
/// ```
///
/// In conclusion: always check if the index you want to get really exists
/// before doing it.
/// Use [`get`] and [`get_mut`] if you want to check whether the index is in
/// the `Vec`.
///
/// # Slicing
///
Expand Down Expand Up @@ -277,6 +277,8 @@ use crate::raw_vec::RawVec;
/// The order has changed in the past and may change again.
///
/// [`vec!`]: ../../std/macro.vec.html
/// [`get`]: ../../std/vec/struct.Vec.html#method.get
/// [`get_mut`]: ../../std/vec/struct.Vec.html#method.get_mut
/// [`Index`]: ../../std/ops/trait.Index.html
/// [`String`]: ../../std/string/struct.String.html
/// [`&str`]: ../../std/primitive.str.html
Expand Down

0 comments on commit ea3548b

Please sign in to comment.