mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
Use instead of for consistency
This commit is contained in:
1 parent
1619cd5afe
commit
952fff0ee4
1 file changed
+5
-3
+5
-3
@@ -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!())
|
||||
.setting(AppSettings::ColorAuto)
|
||||
.setting(AppSettings::ColoredHelp)
|
||||
@@ -218,7 +218,7 @@ fn run() -> io::Result<()> {
|
||||
.help("read only N bytes from the input"),
|
||||
);
|
||||
|
||||
let matches = app.get_matches();
|
||||
let matches = app.get_matches_safe()?;
|
||||
|
||||
let stdin = io::stdin();
|
||||
|
||||
@@ -270,7 +270,9 @@ fn main() {
|
||||
let result = run();
|
||||
match result {
|
||||
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);
|
||||
}
|
||||
Ok(()) => {}
|
||||
|
||||
Reference in new issue
Block a user