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-diary/src/lib.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-diary/src/lib.rs')
-rw-r--r-- | bin/domain/imag-diary/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/domain/imag-diary/src/lib.rs b/bin/domain/imag-diary/src/lib.rs index 72984106..b781fdc3 100644 --- a/bin/domain/imag-diary/src/lib.rs +++ b/bin/domain/imag-diary/src/lib.rs @@ -35,7 +35,7 @@ )] #[macro_use] extern crate log; -#[macro_use] extern crate failure; +#[macro_use] extern crate anyhow; extern crate resiter; extern crate clap; extern crate chrono; @@ -61,9 +61,9 @@ use libimagrt::application::ImagApplication; use itertools::Itertools; use clap::App; -use failure::Fallible as Result; -use failure::err_msg; -use failure::Error; +use anyhow::Result; + +use anyhow::Error; mod create; mod delete; @@ -84,7 +84,7 @@ use crate::view::view; pub enum ImagDiary {} impl ImagApplication for ImagDiary { fn run(rt: Runtime) -> Result<()> { - match rt.cli().subcommand_name().ok_or_else(|| err_msg("No subcommand called"))? { + match rt.cli().subcommand_name().ok_or_else(|| anyhow!("No subcommand called"))? { "diaries" => diaries(&rt), "create" => create(&rt), "delete" => delete(&rt), @@ -95,7 +95,7 @@ impl ImagApplication for ImagDiary { if rt.handle_unknown_subcommand("imag-diary", other, rt.cli())?.success() { Ok(()) } else { - Err(err_msg("Failed to handle unknown subcommand")) + Err(anyhow!("Failed to handle unknown subcommand")) } }, } |