Return Result from main (requires Rust 1.26)

This commit is contained in:
Magnus Hoff 2018-05-12 14:34:09 +02:00
parent b1b1a91db1
commit c72ee90929

View file

@ -49,7 +49,7 @@ fn args<'a>() -> clap::ArgMatches<'a> {
.get_matches() .get_matches()
} }
fn core_main() -> Result<(), Box<std::error::Error>> { fn main() -> Result<(), Box<std::error::Error>> {
let args = args(); let args = args();
const CLAP: &str = "Guaranteed by clap"; const CLAP: &str = "Guaranteed by clap";
@ -67,13 +67,3 @@ fn core_main() -> Result<(), Box<std::error::Error>> {
trust_identity, trust_identity,
) )
} }
fn main() {
match core_main() {
Ok(()) => (),
Err(err) => {
eprintln!("{:#?}", err);
std::process::exit(1)
}
}
}