Return Result from main (requires Rust 1.26)
This commit is contained in:
parent
b1b1a91db1
commit
c72ee90929
1 changed files with 1 additions and 11 deletions
12
src/main.rs
12
src/main.rs
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue