Rollup merge of #68733 - cata0309:patch-1, r=Dylan-DPC
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:
commit
f2cc0cc09d
@ -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
Block a user