summaryrefslogtreecommitdiffstats
path: root/bin/core/imag-store
diff options
context:
space:
mode:
Diffstat (limited to 'bin/core/imag-store')
-rw-r--r--bin/core/imag-store/Cargo.toml4
-rw-r--r--bin/core/imag-store/src/create.rs6
-rw-r--r--bin/core/imag-store/src/delete.rs2
-rw-r--r--bin/core/imag-store/src/get.rs6
-rw-r--r--bin/core/imag-store/src/lib.rs10
-rw-r--r--bin/core/imag-store/src/retrieve.rs2
-rw-r--r--bin/core/imag-store/src/update.rs2
-rw-r--r--bin/core/imag-store/src/verify.rs8
8 files changed, 20 insertions, 20 deletions
diff --git a/bin/core/imag-store/Cargo.toml b/bin/core/imag-store/Cargo.toml
index d7a92de7..ae582e58 100644
--- a/bin/core/imag-store/Cargo.toml
+++ b/bin/core/imag-store/Cargo.toml
@@ -22,7 +22,7 @@ maintenance = { status = "actively-developed" }
[dependencies]
log = "0.4.6"
toml = "0.5.1"
-failure = "0.1.5"
+anyhow = "1"
resiter = "0.4.0"
libimagstore = { version = "0.10.0", path = "../../../lib/core/libimagstore", features = ["verify"] }
@@ -39,7 +39,7 @@ features = ["color", "suggestions", "wrap_help"]
early-panic = [ "libimagstore/early-panic" ]
[dev-dependencies]
-toml-query = "0.9.2"
+toml-query = { git = "https://github.com/matthiasbeyer/toml-query", branch = "master" }
[dev-dependencies.libimagutil]
version = "0.10.0"
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"))
}
}