Completed exercise up to Traits

This commit is contained in:
Samuele Iacoponi
2026-02-01 16:38:57 +01:00
parent 9ef3441dba
commit b1b81f7e07
33 changed files with 732 additions and 71 deletions

View File

@@ -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)?);