1
Fork 0

core: Add unwrap()/unwrap_err() methods to Result

These implementations must live in libstd right now because the fmt module has
not been migrated yet. This will occur in a later PR.

Just to be clear, there are new extension traits, but they are not necessary
once the std::fmt module has migrated to libcore, which is a planned migration
in the future.
This commit is contained in:
Alex Crichton 2014-05-01 11:12:16 -07:00
parent a156534a96
commit d4b5d82a33
12 changed files with 327 additions and 6 deletions

View file

@ -436,7 +436,7 @@ mod test {
#[test]
fn rng() {
use rand::{StdRng, Rng};
let mut r = StdRng::new().unwrap();
let mut r = StdRng::new().ok().unwrap();
let _ = r.next_u32();
}