diff options
Diffstat (limited to 'bin/core/imag-header')
-rw-r--r-- | bin/core/imag-header/Cargo.toml | 2 | ||||
-rw-r--r-- | bin/core/imag-header/src/lib.rs | 16 | ||||
-rw-r--r-- | bin/core/imag-header/src/ui.rs | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/bin/core/imag-header/Cargo.toml b/bin/core/imag-header/Cargo.toml index 24a14756..6f293f0c 100644 --- a/bin/core/imag-header/Cargo.toml +++ b/bin/core/imag-header/Cargo.toml @@ -25,7 +25,7 @@ version = "3.0.0" toml = "0.5.1" toml-query = "0.9.2" filters = "0.3.0" -failure = "0.1.5" +anyhow = "1" resiter = "0.4.0" libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore" } diff --git a/bin/core/imag-header/src/lib.rs b/bin/core/imag-header/src/lib.rs index b024ac07..40951d1a 100644 --- a/bin/core/imag-header/src/lib.rs +++ b/bin/core/imag-header/src/lib.rs @@ -34,7 +34,7 @@ extern crate clap; #[macro_use] extern crate log; -#[macro_use] extern crate failure; +#[macro_use] extern crate anyhow; extern crate toml; extern crate toml_query; extern crate filters; @@ -53,9 +53,9 @@ use std::string::ToString; use clap::{App, ArgMatches}; use filters::filter::Filter; use toml::Value; -use failure::Error; -use failure::Fallible as Result; -use failure::err_msg; +use anyhow::Error; +use anyhow::Result; + use resiter::FilterMap; use resiter::AndThen; use resiter::IterInnerOkOrElse; @@ -87,11 +87,11 @@ impl ImagApplication for ImagHeader { let iter = rt .ids::<crate::ui::PathProvider>()? - .ok_or_else(|| err_msg("No ids supplied"))? + .ok_or_else(|| anyhow!("No ids supplied"))? .into_iter() .map(Ok) .into_get_iter(rt.store()) - .map_inner_ok_or_else(|| err_msg("Did not find one entry")); + .map_inner_ok_or_else(|| anyhow!("Did not find one entry")); match rt.cli().subcommand() { ("read", Some(mtch)) => read(&rt, mtch, iter), @@ -109,7 +109,7 @@ impl ImagApplication for ImagHeader { { Ok(()) } else { - Err(format_err!("Subcommand failed")) + Err(anyhow!("Subcommand failed")) } }, } @@ -144,7 +144,7 @@ fn read<'a, 'e, I>(rt: &Runtime, mtch: &ArgMatches<'a>, iter: I) -> Result<()> trace!("Processing headers: working on {:?}", entry.get_location()); entry.get_header() .read(header_path)? - .ok_or_else(|| format_err!("Value not present for entry {} at {}", entry.get_location(), header_path)) + .ok_or_else(|| anyhow!("Value not present for entry {} at {}", entry.get_location(), header_path)) .and_then(|value| { trace!("Processing headers: Got value {:?}", value); diff --git a/bin/core/imag-header/src/ui.rs b/bin/core/imag-header/src/ui.rs index c7a41225..4c7edd6a 100644 --- a/bin/core/imag-header/src/ui.rs +++ b/bin/core/imag-header/src/ui.rs @@ -20,7 +20,7 @@ use std::path::PathBuf; use clap::{Arg, ArgMatches, App, SubCommand}; -use failure::Fallible as Result; +use anyhow::Result; use libimagstore::storeid::StoreId; use libimagstore::storeid::IntoStoreId; |