diff options
| author | Faris Sufyan <47665123+Dolpheyn@users.noreply.github.com> | 2020-05-13 21:13:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-13 21:13:35 +0800 |
| commit | 6c3856f3ec5bbcd1c748d01a463f04a8fef0bd6c (patch) | |
| tree | 1bfd663ad2860420b09b8a10a0f2e956f54fd04e /src/libcore | |
| parent | ef1688db8e33b635287462854b7203f86c7acbf5 (diff) | |
| download | rust-6c3856f3ec5bbcd1c748d01a463f04a8fef0bd6c.tar.gz rust-6c3856f3ec5bbcd1c748d01a463f04a8fef0bd6c.zip | |
Update src/libcore/option.rs
Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/option.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index ebaa4894862..e8483875c97 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -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> { |
