From ce2bb561b4c25fc940ce6487534dcff2b74d0638 Mon Sep 17 00:00:00 2001 From: Andrew Hlynskyi Date: Mon, 7 Jun 2021 21:11:49 +0300 Subject: [PATCH] chore(cli): Panic on broken pipe; review fixes --- cli/src/error.rs | 3 +-- cli/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/src/error.rs b/cli/src/error.rs index e4160817..e84e84fe 100644 --- a/cli/src/error.rs +++ b/cli/src/error.rs @@ -25,8 +25,7 @@ impl Error { } pub fn new(message: String) -> Self { - let e = Error(Some(vec![message])); - e + Error(Some(vec![message])) } pub fn new_ignored() -> Self { diff --git a/cli/src/main.rs b/cli/src/main.rs index 7c2774fe..0454772c 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -14,7 +14,7 @@ const BUILD_VERSION: &'static str = env!("CARGO_PKG_VERSION"); const BUILD_SHA: Option<&'static str> = option_env!("BUILD_SHA"); fn main() { - if let Err(ref e) = run() { + if let Err(e) = run() { if e.is_ignored() { exit(0); }