doc: mention get(_mut) in Vec
This commit is contained in:
@@ -154,8 +154,8 @@ use crate::raw_vec::RawVec;
|
|||||||
/// println!("{}", v[6]); // it will panic!
|
/// println!("{}", v[6]); // it will panic!
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// In conclusion: always check if the index you want to get really exists
|
/// Use [`get`] and [`get_mut`] if you want to check whether the index is in
|
||||||
/// before doing it.
|
/// the `Vec`.
|
||||||
///
|
///
|
||||||
/// # Slicing
|
/// # Slicing
|
||||||
///
|
///
|
||||||
@@ -277,6 +277,8 @@ use crate::raw_vec::RawVec;
|
|||||||
/// The order has changed in the past and may change again.
|
/// The order has changed in the past and may change again.
|
||||||
///
|
///
|
||||||
/// [`vec!`]: ../../std/macro.vec.html
|
/// [`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
|
/// [`Index`]: ../../std/ops/trait.Index.html
|
||||||
/// [`String`]: ../../std/string/struct.String.html
|
/// [`String`]: ../../std/string/struct.String.html
|
||||||
/// [`&str`]: ../../std/primitive.str.html
|
/// [`&str`]: ../../std/primitive.str.html
|
||||||
|
|||||||
Reference in New Issue
Block a user