Update src/libcore/option.rs

Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
This commit is contained in:
Faris Sufyan 2020-05-13 21:13:27 +08:00 committed by GitHub
parent f445a8286e
commit ef1688db8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1411,6 +1411,7 @@ impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T> {
/// Some(t) => *t = String::from("Hello, Rustaceans!"),
/// None => (),
/// }
///
/// assert_eq!(s, Some(String::from("Hello, Rustaceans!")));
/// ```
fn from(o: &'a mut Option<T>) -> Option<&'a mut T> {