summaryrefslogtreecommitdiffstats
path: root/bin/core/imag-diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'bin/core/imag-diagnostics')
-rw-r--r--bin/core/imag-diagnostics/Cargo.toml4
-rw-r--r--bin/core/imag-diagnostics/src/lib.rs12
2 files changed, 8 insertions, 8 deletions
diff --git a/bin/core/imag-diagnostics/Cargo.toml b/bin/core/imag-diagnostics/Cargo.toml
index 557e3f7d..2dafe4ba 100644
--- a/bin/core/imag-diagnostics/Cargo.toml
+++ b/bin/core/imag-diagnostics/Cargo.toml
@@ -16,9 +16,9 @@ homepage = "http://imag-pim.org"
[dependencies]
log = "0.4.6"
toml = "0.5.1"
-toml-query = "0.9.2"
+toml-query = { git = "https://github.com/matthiasbeyer/toml-query", branch = "master" }
indicatif = "0.14.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-diagnostics/src/lib.rs b/bin/core/imag-diagnostics/src/lib.rs
index 427abc67..ac7963f9 100644
--- a/bin/core/imag-diagnostics/src/lib.rs
+++ b/bin/core/imag-diagnostics/src/lib.rs
@@ -38,7 +38,7 @@ extern crate clap;
extern crate toml;
extern crate toml_query;
extern crate indicatif;
-extern crate failure;
+#[macro_use] extern crate anyhow;
extern crate resiter;
#[macro_use] extern crate log;
@@ -58,8 +58,8 @@ use libimagentrylink::linkable::Linkable;
use toml::Value;
use toml_query::read::TomlValueReadExt;
use indicatif::{ProgressIterator, ProgressBar, ProgressStyle};
-use failure::Fallible as Result;
-use failure::err_msg;
+use anyhow::Result;
+
use clap::App;
use resiter::AndThen;
use resiter::IterInnerOkOrElse;
@@ -132,7 +132,7 @@ impl ImagApplication for ImagDiagnostics {
let diags = rt.store()
.entries()?
.into_get_iter()
- .map_inner_ok_or_else(|| err_msg("Unable to get entry"))
+ .map_inner_ok_or_else(|| anyhow!("Unable to get entry"))
.progress_with(progressbar)
.and_then_ok(|e| {
let diag = Diagnostic::for_entry(&e);
@@ -254,11 +254,11 @@ impl ImagApplication for ImagDiagnostics {
}
fn get_config(rt: &Runtime, s: &'static str) -> Result<Option<String>> {
- let cfg = rt.config().ok_or_else(|| err_msg("No configuration"))?;
+ let cfg = rt.config().ok_or_else(|| anyhow!("No configuration"))?;
match cfg.read(s)? {
Some(&Value::String(ref s)) => Ok(Some(s.to_owned())),
- Some(_) => Err(err_msg("Config type wrong: 'rt.progressbar_style' should be a string")),
+ Some(_) => Err(anyhow!("Config type wrong: 'rt.progressbar_style' should be a string")),
None => Ok(None),
}
}