Last active
February 22, 2018 02:14
-
-
Save U007D/fdb165d302e0f55a01f16c81c9f1a115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let opt = Opt::from_args(); | |
if let Err(err) = run(&opt) { | |
eprintln!("error: {}", err); | |
std::process::exit(1); | |
} | |
} | |
// -> | |
#![feature(termination_trait)] | |
extern crate failure; | |
use failure::Error as FailureError; | |
type Result<T> = std::result::Result<(), FailureError> | |
fn main() -> Result<()> { | |
let opt = Opt::from_args(); | |
run(&opt) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
8 lines of logic -> 4 (or 3 with
run(&Opt::from_args)
).