summaryrefslogtreecommitdiff
path: root/rustlings/exercises/13_error_handling/errors3.rs
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-09-27 12:11:32 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-09-27 12:11:32 -0500
commitb9b008c1d4a730335bdc9d465b0fdf7869fb09d4 (patch)
treee9695905445b4bab89c07b8662fe40207b74c288 /rustlings/exercises/13_error_handling/errors3.rs
parent1da0f56d76e5d5117eac05af092bf0ab58b14c8f (diff)
rustlings: complete 13
Diffstat (limited to 'rustlings/exercises/13_error_handling/errors3.rs')
-rw-r--r--rustlings/exercises/13_error_handling/errors3.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/rustlings/exercises/13_error_handling/errors3.rs b/rustlings/exercises/13_error_handling/errors3.rs
index 8e8c38a..bf21bbc 100644
--- a/rustlings/exercises/13_error_handling/errors3.rs
+++ b/rustlings/exercises/13_error_handling/errors3.rs
@@ -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(())
}