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 /bin/domain/imag-mail/src/util.rs | |
parent | 00aa4df88edae1d5eeb3fb365af05f95bd0de3b4 (diff) | |
parent | 666193dfc26181b6606cb85de5389c4ed6ece5eb (diff) |
Merge branch 'replace-failure-with-anyhow'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'bin/domain/imag-mail/src/util.rs')
-rw-r--r-- | bin/domain/imag-mail/src/util.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/domain/imag-mail/src/util.rs b/bin/domain/imag-mail/src/util.rs index 7f116649..bdd27ba2 100644 --- a/bin/domain/imag-mail/src/util.rs +++ b/bin/domain/imag-mail/src/util.rs @@ -21,9 +21,9 @@ use std::collections::BTreeMap; use std::io::Write; use clap::ArgMatches; -use failure::Error; -use failure::Fallible as Result; -use failure::err_msg; +use anyhow::Error; +use anyhow::Result; + use handlebars::Handlebars; use toml_query::read::TomlValueReadTypeExt; @@ -37,10 +37,10 @@ pub fn get_mail_print_format(config_value_path: &'static str, rt: &Runtime, scmd Some(s) => Ok(s), None => { rt.config() - .ok_or_else(|| err_msg("No configuration file"))? + .ok_or_else(|| anyhow!("No configuration file"))? .read_string(config_value_path) .map_err(Error::from)? - .ok_or_else(|| format_err!("Configuration '{}' does not exist", config_value_path)) + .ok_or_else(|| anyhow!("Configuration '{}' does not exist", config_value_path)) } }?; |