mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 21:29:18 +00:00
Finished Errors5
This commit is contained in:
parent
14826e6232
commit
2ad8b9b469
@ -4,7 +4,6 @@
|
|||||||
// It won't compile right now! Why?
|
// It won't compile right now! Why?
|
||||||
// Execute `rustlings hint errors5` for hints!
|
// Execute `rustlings hint errors5` for hints!
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
@ -14,7 +13,7 @@ use std::num::ParseIntError;
|
|||||||
fn main() -> Result<(), ParseIntError> {
|
fn main() -> Result<(), ParseIntError> {
|
||||||
let pretend_user_input = "42";
|
let pretend_user_input = "42";
|
||||||
let x: i64 = pretend_user_input.parse()?;
|
let x: i64 = pretend_user_input.parse()?;
|
||||||
println!("output={:?}", PositiveNonzeroInteger::new(x)?);
|
println!("output={:?}", PositiveNonzeroInteger::new(x)); // The ? here seemed to be superfluous as the erro handlnig had already bee instantiated
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user