Skip to content

Commit

Permalink
Stabilize expect_err feature, closes #39041
Browse files Browse the repository at this point in the history
  • Loading branch information
aturon authored and alexcrichton committed Mar 17, 2017
1 parent 33a5665 commit 65b7c4e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,11 @@ impl<T: fmt::Debug, E> Result<T, E> {
/// Basic usage:
///
/// ```{.should_panic}
/// # #![feature(result_expect_err)]
/// let x: Result<u32, &str> = Ok(10);
/// x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
/// ```
#[inline]
#[unstable(feature = "result_expect_err", issue = "39041")]
#[stable(feature = "result_expect_err", since = "1.17.0")]
pub fn expect_err(self, msg: &str) -> E {
match self {
Ok(t) => unwrap_failed(msg, t),
Expand Down

0 comments on commit 65b7c4e

Please sign in to comment.