summaryrefslogtreecommitdiffstats
path: root/bin/core/imag-header/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/core/imag-header/src/lib.rs')
-rw-r--r--bin/core/imag-header/src/lib.rs16
1 files changed, 8 insertions, 8 deletions
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);