Skip to content

Commit

Permalink
Stabilize expect_err feature, closes rust-lang#39041
Browse files Browse the repository at this point in the history
  • Loading branch information
aturon committed Mar 15, 2017
1 parent f23d448 commit 5b4a1b6
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 5b4a1b6

Please sign in to comment.