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

@@ -15,7 +15,7 @@ fn total_cost(item_quantity: &str) -> Result<i32, ParseIntError> {
// TODO: Fix the compiler error by changing the signature and body of the
// `main` function.
fn main() {
fn main() -> Result<(), ParseIntError>{
let mut tokens = 100;
let pretend_user_input = "8";
@@ -28,4 +28,6 @@ fn main() {
tokens -= cost;
println!("You now have {tokens} tokens.");
}
Ok(())
}