Skip to content

Commit 2ce14b8

Browse files
Update option.rs
I updated the example of the `expect` examples so they won't contain depressing sentences any more !
1 parent 6c0b779 commit 2ce14b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/option.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ impl<T> Option<T> {
331331
///
332332
/// ```
333333
/// let x = Some("value");
334-
/// assert_eq!(x.expect("the world is ending"), "value");
334+
/// assert_eq!(x.expect("fruits are healthy"), "value");
335335
/// ```
336336
///
337337
/// ```{.should_panic}
338338
/// let x: Option<&str> = None;
339-
/// x.expect("the world is ending"); // panics with `the world is ending`
339+
/// x.expect("fruits are healthy"); // panics with `fruits are healthy`
340340
/// ```
341341
#[inline]
342342
#[track_caller]

0 commit comments

Comments
 (0)