Use instead of for consistency

This commit is contained in:
arnavb11 authored and David Peter committed 2019-01-13 18:03:07 +01:00
1 parent 1619cd5afe
commit 952fff0ee4
1 file changed
+5 -3
+5 -3
View File
@@ -200,7 +200,7 @@ impl<'a> Printer<'a> {
} }
} }
fn run() -> io::Result<()> { fn run() -> Result<(), Box<::std::error::Error>> {
let app = App::new(crate_name!()) let app = App::new(crate_name!())
.setting(AppSettings::ColorAuto) .setting(AppSettings::ColorAuto)
.setting(AppSettings::ColoredHelp) .setting(AppSettings::ColoredHelp)
@@ -218,7 +218,7 @@ fn run() -> io::Result<()> {
.help("read only N bytes from the input"), .help("read only N bytes from the input"),
); );
let matches = app.get_matches(); let matches = app.get_matches_safe()?;
let stdin = io::stdin(); let stdin = io::stdin();
@@ -270,7 +270,9 @@ fn main() {
let result = run(); let result = run();
match result { match result {
Err(err) => { Err(err) => {
eprintln!("Error: {}", err); // The whitespace is being removed from the right because
// clap errors add a newline to the end of the output already
eprintln!("Error: {}", format!("{}", err).trim_right());
std::process::exit(1); std::process::exit(1);
} }
Ok(()) => {} Ok(()) => {}