From 608ce4ffac4014e643c162c8254e98fa3c9e0dc9 Mon Sep 17 00:00:00 2001 From: Rock070 Date: Sun, 31 Dec 2023 04:05:36 +0800 Subject: [PATCH] Update return type of main() to use Box --- exercises/13_error_handling/errors5.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exercises/13_error_handling/errors5.rs b/exercises/13_error_handling/errors5.rs index 92461a7e..10490b13 100644 --- a/exercises/13_error_handling/errors5.rs +++ b/exercises/13_error_handling/errors5.rs @@ -22,14 +22,12 @@ // Execute `rustlings hint errors5` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE - -use std::error; +use std::error::{self, Error}; use std::fmt; use std::num::ParseIntError; // TODO: update the return type of `main()` to make this compile. -fn main() -> Result<(), Box> { +fn main() -> Result<(), Box> { let pretend_user_input = "42"; let x: i64 = pretend_user_input.parse()?; println!("output={:?}", PositiveNonzeroInteger::new(x)?);