Update src/libcore/option.rs
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
This commit is contained in:
parent
644bb24e33
commit
adc2bf0cfe
1 changed files with 1 additions and 0 deletions
|
|
@ -1376,6 +1376,7 @@ impl<'a, T> From<&'a Option<T>> for Option<&'a T> {
|
|||
/// Converts from `&Option<T>` to `Option<&T>`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Converts an `Option<`[`String`]`>` into an `Option<`[`usize`]`>`, preserving the original.
|
||||
/// The [`map`] method takes the `self` argument by value, consuming the original,
|
||||
/// so this technique uses `as_ref` to first take an `Option` to a reference
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue