From 0635bffd789b95fa9ae8b363be65e25329893191 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 5 Sep 2016 19:34:12 +0200 Subject: [PATCH] imag-store: Use util fn warn_exit() --- imag-store/src/delete.rs | 11 +++-------- imag-store/src/verify.rs | 6 ++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/imag-store/src/delete.rs b/imag-store/src/delete.rs index 537b638d..70594e2a 100644 --- a/imag-store/src/delete.rs +++ b/imag-store/src/delete.rs @@ -3,6 +3,7 @@ use std::path::PathBuf; use libimagrt::runtime::Runtime; use libimagerror::trace::trace_error_exit; use libimagstore::storeid::StoreId; +use libimagutil::warn_exit::warn_exit; pub fn delete(rt: &Runtime) { use std::process::exit; @@ -24,14 +25,8 @@ pub fn delete(rt: &Runtime) { exit(1); }) }) - .or_else(|| { - warn!("No ID passed. Will exit now"); - exit(1); - }) + .or_else(|| warn_exit("No ID passed. Will exit now", 1)) }) - .or_else(|| { - warn!("No subcommand 'delete'. Will exit now"); - exit(1); - }); + .or_else(|| warn_exit("No subcommand 'delete'. Will exit now", 1)); } diff --git a/imag-store/src/verify.rs b/imag-store/src/verify.rs index ca836e3f..b22d5909 100644 --- a/imag-store/src/verify.rs +++ b/imag-store/src/verify.rs @@ -1,13 +1,11 @@ -use std::process::exit; - use libimagrt::runtime::Runtime; +use libimagutil::warn_exit::warn_exit; pub fn verify(rt: &Runtime) { if rt.store().verify() { info!("Store seems to be fine"); } else { - warn!("Store seems to be broken somehow"); - exit(1); + warn_exit("Store seems to be broken somehow", 1); } }