diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-27 12:11:32 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-27 12:11:32 -0500 |
| commit | b9b008c1d4a730335bdc9d465b0fdf7869fb09d4 (patch) | |
| tree | e9695905445b4bab89c07b8662fe40207b74c288 /rustlings/exercises/13_error_handling/errors2.rs | |
| parent | 1da0f56d76e5d5117eac05af092bf0ab58b14c8f (diff) | |
rustlings: complete 13
Diffstat (limited to 'rustlings/exercises/13_error_handling/errors2.rs')
| -rw-r--r-- | rustlings/exercises/13_error_handling/errors2.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rustlings/exercises/13_error_handling/errors2.rs b/rustlings/exercises/13_error_handling/errors2.rs index defe359..3d850f7 100644 --- a/rustlings/exercises/13_error_handling/errors2.rs +++ b/rustlings/exercises/13_error_handling/errors2.rs @@ -21,7 +21,7 @@ fn total_cost(item_quantity: &str) -> Result<i32, ParseIntError> { let cost_per_item = 5; // TODO: Handle the error case as described above. - let qty = item_quantity.parse::<i32>(); + let qty = item_quantity.parse::<i32>()?; Ok(qty * cost_per_item + processing_fee) } |