diff options
Diffstat (limited to 'bin/core/imag-store/src')
-rw-r--r-- | bin/core/imag-store/src/create.rs | 6 | ||||
-rw-r--r-- | bin/core/imag-store/src/delete.rs | 2 | ||||
-rw-r--r-- | bin/core/imag-store/src/get.rs | 6 | ||||
-rw-r--r-- | bin/core/imag-store/src/lib.rs | 10 | ||||
-rw-r--r-- | bin/core/imag-store/src/retrieve.rs | 2 | ||||
-rw-r--r-- | bin/core/imag-store/src/update.rs | 2 | ||||
-rw-r--r-- | bin/core/imag-store/src/verify.rs | 8 |
7 files changed, 18 insertions, 18 deletions
diff --git a/bin/core/imag-store/src/create.rs b/bin/core/imag-store/src/create.rs index 4d13d444..d916d14d 100644 --- a/bin/core/imag-store/src/create.rs +++ b/bin/core/imag-store/src/create.rs @@ -25,8 +25,8 @@ use std::io::Read; use clap::ArgMatches; use toml::Value; -use failure::Fallible as Result; -use failure::err_msg; +use anyhow::Result; + use libimagrt::runtime::Runtime; use libimagstore::store::Entry; @@ -88,7 +88,7 @@ fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> R fn create_from_source(rt: &Runtime, matches: &ArgMatches, path: &StoreId) -> Result<()> { let content = matches .value_of("from-raw") - .ok_or_else(|| err_msg("No Commandline call")) + .ok_or_else(|| anyhow!("No Commandline call")) .map(string_from_raw_src)?; debug!("Content with len = {}", content.len()); diff --git a/bin/core/imag-store/src/delete.rs b/bin/core/imag-store/src/delete.rs index 8609369c..3f92bab4 100644 --- a/bin/core/imag-store/src/delete.rs +++ b/bin/core/imag-store/src/delete.rs @@ -19,7 +19,7 @@ use std::path::PathBuf; -use failure::Fallible as Result; +use anyhow::Result; use libimagrt::runtime::Runtime; use libimagstore::storeid::StoreId; diff --git a/bin/core/imag-store/src/get.rs b/bin/core/imag-store/src/get.rs index c1e4410c..9cfe982e 100644 --- a/bin/core/imag-store/src/get.rs +++ b/bin/core/imag-store/src/get.rs @@ -19,8 +19,8 @@ use std::path::PathBuf; -use failure::Fallible as Result; -use failure::err_msg; +use anyhow::Result; + use libimagrt::runtime::Runtime; use libimagstore::storeid::StoreId; @@ -36,7 +36,7 @@ pub fn get(rt: &Runtime) -> Result<()> { debug!("path = {:?}", path); match rt.store().get(path.clone())? { - None => Err(err_msg("No entry found")), + None => Err(anyhow!("No entry found")), Some(entry) => { print_entry(rt, scmd, entry)?; rt.report_touched(&path) diff --git a/bin/core/imag-store/src/lib.rs b/bin/core/imag-store/src/lib.rs index 4cdd7936..4b065756 100644 --- a/bin/core/imag-store/src/lib.rs +++ b/bin/core/imag-store/src/lib.rs @@ -39,7 +39,7 @@ extern crate clap; extern crate toml; extern crate resiter; #[cfg(test)] extern crate toml_query; -#[macro_use] extern crate failure; +#[macro_use] extern crate anyhow; extern crate libimagrt; extern crate libimagstore; @@ -55,8 +55,8 @@ extern crate libimagutil; use libimagrt::application::ImagApplication; use libimagrt::runtime::Runtime; -use failure::Fallible as Result; -use failure::err_msg; +use anyhow::Result; + mod create; mod delete; @@ -99,12 +99,12 @@ impl ImagApplication for ImagStore { if rt.handle_unknown_subcommand("imag-store", other, rt.cli())?.success() { Ok(()) } else { - Err(format_err!("Subcommand failed")) + Err(anyhow!("Subcommand failed")) } }, } } else { - Err(err_msg("No command")) + Err(anyhow!("No command")) } } diff --git a/bin/core/imag-store/src/retrieve.rs b/bin/core/imag-store/src/retrieve.rs index 92f7b4e4..61383571 100644 --- a/bin/core/imag-store/src/retrieve.rs +++ b/bin/core/imag-store/src/retrieve.rs @@ -20,7 +20,7 @@ use std::path::PathBuf; use std::io::Write; -use failure::Fallible as Result; +use anyhow::Result; use clap::ArgMatches; use libimagstore::store::FileLockEntry; diff --git a/bin/core/imag-store/src/update.rs b/bin/core/imag-store/src/update.rs index d04f0d2d..1c857d69 100644 --- a/bin/core/imag-store/src/update.rs +++ b/bin/core/imag-store/src/update.rs @@ -20,7 +20,7 @@ use std::ops::DerefMut; use std::path::PathBuf; -use failure::Fallible as Result; +use anyhow::Result; use libimagrt::runtime::Runtime; use libimagstore::storeid::StoreId; diff --git a/bin/core/imag-store/src/verify.rs b/bin/core/imag-store/src/verify.rs index 698c0c07..83498958 100644 --- a/bin/core/imag-store/src/verify.rs +++ b/bin/core/imag-store/src/verify.rs @@ -19,8 +19,8 @@ use std::ops::Deref; -use failure::Fallible as Result; -use failure::err_msg; +use anyhow::Result; + use resiter::AndThen; use resiter::IterInnerOkOrElse; @@ -36,7 +36,7 @@ pub fn verify(rt: &Runtime) -> Result<()> { .store() .entries()? .into_get_iter() - .map_inner_ok_or_else(|| err_msg("Did not find one entry")) + .map_inner_ok_or_else(|| anyhow!("Did not find one entry")) .and_then_ok(|fle| { let p = fle.get_location(); let content_len = fle.get_content().len(); @@ -58,7 +58,7 @@ pub fn verify(rt: &Runtime) -> Result<()> { info!("Store seems to be fine"); Ok(()) } else { - Err(err_msg("Store seems to be broken somehow")) + Err(anyhow!("Store seems to be broken somehow")) } } |