mirror of https://github.com/rust-lang/rust.git
Update option.rs
I updated the example of the `expect` examples so they won't contain depressing sentences any more !
This commit is contained in:
parent
6c0b779b7b
commit
2ce14b8a19
|
@ -331,12 +331,12 @@ impl<T> Option<T> {
|
|||
///
|
||||
/// ```
|
||||
/// let x = Some("value");
|
||||
/// assert_eq!(x.expect("the world is ending"), "value");
|
||||
/// assert_eq!(x.expect("fruits are healthy"), "value");
|
||||
/// ```
|
||||
///
|
||||
/// ```{.should_panic}
|
||||
/// let x: Option<&str> = None;
|
||||
/// x.expect("the world is ending"); // panics with `the world is ending`
|
||||
/// x.expect("fruits are healthy"); // panics with `fruits are healthy`
|
||||
/// ```
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
|
|
Loading…
Reference in New Issue