Skip to content

Commit

Permalink
Fix use of result_unwrap_or_default feature
Browse files Browse the repository at this point in the history
  • Loading branch information
devonhollowood committed Oct 21, 2016
1 parent 0958505 commit 5d31a81
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ impl<T: Default, E> Result<T, E> {
/// `Err` on error.
///
/// ```
/// #![feature(result_unwrap_or_default)]
///
/// let good_year_from_input = "1909";
/// let bad_year_from_input = "190blarg";
/// let good_year = good_year_from_input.parse().unwrap_or_default();
Expand Down
1 change: 1 addition & 0 deletions src/libcoretest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#![feature(unique)]
#![feature(iter_max_by)]
#![feature(iter_min_by)]
#![feature(result_unwrap_or_default)]

extern crate core;
extern crate test;
Expand Down
2 changes: 0 additions & 2 deletions src/libcoretest/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(result_unwrap_or_default)]

fn op1() -> Result<isize, &'static str> { Ok(666) }
fn op2() -> Result<isize, &'static str> { Err("sadface") }

Expand Down

0 comments on commit 5d31a81

Please sign in to comment.