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:
parent
a156534a96
commit
d4b5d82a33
12 changed files with 327 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue