Skip to content

Commit

Permalink
Rollup merge of rust-lang#68733 - cata0309:patch-1, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Update option.rs

I updated the example of the `expect` examples so they won't contain depressing sentences any more !
  • Loading branch information
Centril authored Feb 2, 2020
2 parents cef6894 + 2ce14b8 commit f2cc0cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f2cc0cc

Please sign in to comment.