From dcd82188c3b5e8c3eac94a0faf3ec18eef3c1c7f Mon Sep 17 00:00:00 2001 From: Rock070 Date: Sun, 31 Dec 2023 03:56:39 +0800 Subject: [PATCH] Fix error handling in main function --- exercises/13_error_handling/errors3.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exercises/13_error_handling/errors3.rs b/exercises/13_error_handling/errors3.rs index d42d3b17..ff9705e4 100644 --- a/exercises/13_error_handling/errors3.rs +++ b/exercises/13_error_handling/errors3.rs @@ -7,15 +7,13 @@ // Execute `rustlings hint errors3` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE - use std::num::ParseIntError; fn main() { let mut tokens = 100; let pretend_user_input = "8"; - let cost = total_cost(pretend_user_input)?; + let cost = total_cost(pretend_user_input).unwrap(); if cost > tokens { println!("You can't afford that many!");