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:
Mazdak Farrokhzad 2020-02-02 14:15:48 +01:00 committed by GitHub
commit f2cc0cc09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,12 +331,12 @@ impl<T> Option<T> {
/// ///
/// ``` /// ```
/// let x = Some("value"); /// let x = Some("value");
/// assert_eq!(x.expect("the world is ending"), "value"); /// assert_eq!(x.expect("fruits are healthy"), "value");
/// ``` /// ```
/// ///
/// ```{.should_panic} /// ```{.should_panic}
/// let x: Option<&str> = None; /// 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] #[inline]
#[track_caller] #[track_caller]