Skip to content

Commit

Permalink
Update src/libcore/option.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
  • Loading branch information
Dolpheyn and steveklabnik authored May 13, 2020
1 parent ef1688d commit 6c3856f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,9 @@ impl<'a, T> From<&'a Option<T>> for Option<&'a T> {
/// ```
/// let s: Option<String> = Some(String::from("Hello, Rustaceans!"));
/// let o: Option<usize> = Option::from(&s).map(|ss: &String| ss.len());
///
/// println!("Can still print s: {:?}", s);
///
/// assert_eq!(o, Some(18));
/// ```
fn from(o: &'a Option<T>) -> Option<&'a T> {
Expand Down

0 comments on commit 6c3856f

Please sign in to comment.