diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-03-08 12:06:42 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-03-08 12:06:42 +0100 |
commit | cb9f6e7f46eb1a05071947d5f28bb1fe45313734 (patch) | |
tree | 6e5a8e08e5b204f202de335d412de3f69196ce12 /lib/core/libimagstore/src/configuration.rs | |
parent | 00aa4df88edae1d5eeb3fb365af05f95bd0de3b4 (diff) | |
parent | 666193dfc26181b6606cb85de5389c4ed6ece5eb (diff) |
Merge branch 'replace-failure-with-anyhow'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/core/libimagstore/src/configuration.rs')
-rw-r--r-- | lib/core/libimagstore/src/configuration.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/core/libimagstore/src/configuration.rs b/lib/core/libimagstore/src/configuration.rs index 44c21a72..a2b2e1de 100644 --- a/lib/core/libimagstore/src/configuration.rs +++ b/lib/core/libimagstore/src/configuration.rs @@ -19,11 +19,9 @@ use toml::Value; -use failure::Fallible as Result; -use failure::ResultExt; -use failure::Error; - -use libimagerror::errors::ErrorMsg as EM; +use anyhow::Result; +use anyhow::Context; +use anyhow::Error; /// Checks whether the store configuration has a key "implicit-create" which maps to a boolean /// value. If that key is present, the boolean is returned, otherwise false is returned. @@ -34,10 +32,9 @@ pub fn config_implicit_store_create_allowed(config: &Option<Value>) -> Result<bo if let Some(ref t) = *config { t.read_bool(key) - .context(format_err!("Error reading header '{}' in configuration", key)) .map_err(Error::from) - .context(EM::TomlQueryError)? - .ok_or_else(|| format_err!("Config key missing: {}", key)) + .context(anyhow!("Error reading header '{}' in configuration", key))? + .ok_or_else(|| anyhow!("Config key missing: {}", key)) } else { Ok(false) } |