Completed exercise up to Traits
This commit is contained in:
@@ -48,7 +48,7 @@ impl PositiveNonzeroInteger {
|
||||
|
||||
// TODO: Add the correct return type `Result<(), Box<dyn ???>>`. What can we
|
||||
// use to describe both errors? Is there a trait which both errors implement?
|
||||
fn main() {
|
||||
fn main() -> Result<(), Box<dyn Error>>{
|
||||
let pretend_user_input = "42";
|
||||
let x: i64 = pretend_user_input.parse()?;
|
||||
println!("output={:?}", PositiveNonzeroInteger::new(x)?);
|
||||
|
||||
Reference in New Issue
Block a user