mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-03 09:19:18 +00:00
Update return type of main() to use Box<dyn Error>
This commit is contained in:
parent
5a9c46b51e
commit
608ce4ffac
@ -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<dyn ???>> {
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let pretend_user_input = "42";
|
||||
let x: i64 = pretend_user_input.parse()?;
|
||||
println!("output={:?}", PositiveNonzeroInteger::new(x)?);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user