parent
5b13bff520
commit
bbf1dc4fad
@ -393,7 +393,12 @@ pub fn get_mut<I>(&mut self, index: I) -> Option<&mut I::Output>
|
||||
}
|
||||
|
||||
/// Returns a reference to an element or subslice, without doing bounds
|
||||
/// checking. So use it very carefully!
|
||||
/// checking.
|
||||
///
|
||||
/// This is generally not recommended, use with caution! For a safe
|
||||
/// alternative see [`get`].
|
||||
///
|
||||
/// [`get`]: #method.get
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@ -413,7 +418,12 @@ pub unsafe fn get_unchecked<I>(&self, index: I) -> &I::Output
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to an element or subslice, without doing
|
||||
/// bounds checking. So use it very carefully!
|
||||
/// bounds checking.
|
||||
///
|
||||
/// This is generally not recommended, use with caution! For a safe
|
||||
/// alternative see [`get_mut`].
|
||||
///
|
||||
/// [`get_mut`]: #method.get_mut
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
@ -435,6 +435,12 @@ pub unsafe fn get_unchecked_mut<I: SliceIndex<str>>(&mut self, i: I) -> &mut I::
|
||||
/// Creates a string slice from another string slice, bypassing safety
|
||||
/// checks.
|
||||
///
|
||||
/// This is generally not recommended, use with caution! For a safe
|
||||
/// alternative see [`str`] and [`Index`].
|
||||
///
|
||||
/// [`str`]: primitive.str.html
|
||||
/// [`Index`]: ops/trait.Index.html
|
||||
///
|
||||
/// This new slice goes from `begin` to `end`, including `begin` but
|
||||
/// excluding `end`.
|
||||
///
|
||||
@ -477,6 +483,11 @@ pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str {
|
||||
|
||||
/// Creates a string slice from another string slice, bypassing safety
|
||||
/// checks.
|
||||
/// This is generally not recommended, use with caution! For a safe
|
||||
/// alternative see [`str`] and [`IndexMut`].
|
||||
///
|
||||
/// [`str`]: primitive.str.html
|
||||
/// [`IndexMut`]: ops/trait.IndexMut.html
|
||||
///
|
||||
/// This new slice goes from `begin` to `end`, including `begin` but
|
||||
/// excluding `end`.
|
||||
|
Loading…
Reference in New Issue
Block a user