diff options
Diffstat (limited to 'bin/domain/imag-contact/src/edit.rs')
-rw-r--r-- | bin/domain/imag-contact/src/edit.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/domain/imag-contact/src/edit.rs b/bin/domain/imag-contact/src/edit.rs index b276da64..34024949 100644 --- a/bin/domain/imag-contact/src/edit.rs +++ b/bin/domain/imag-contact/src/edit.rs @@ -35,8 +35,8 @@ use std::io::Read; use std::io::Write; -use failure::err_msg; -use failure::Fallible as Result; + +use anyhow::Result; use resiter::Filter; use resiter::Map; use resiter::AndThen; @@ -58,12 +58,12 @@ pub fn edit(rt: &Runtime) -> Result<()> { let retry = !scmd.is_present("fail-on-parse-error"); if rt.output_is_pipe() { - return Err(err_msg("Cannot spawn editor if output is a pipe!")) + return Err(anyhow!("Cannot spawn editor if output is a pipe!")) } let mut output = rt.stdout(); let mut input = rt.stdin().ok_or_else(|| { - err_msg("No input stream. Cannot ask for permission.") + anyhow!("No input stream. Cannot ask for permission.") })?; crate::util::find_contact_by_hash(rt, hash)? @@ -92,13 +92,13 @@ fn edit_contact<'a>(rt: &Runtime, contact: &FileLockEntry<'a>, ref_config: &RefC .get_path(ref_config)?; let success = rt.editor()? - .ok_or_else(|| err_msg("I have no editor configured. Cannot continue!"))? + .ok_or_else(|| anyhow!("I have no editor configured. Cannot continue!"))? .arg(&filepath) .status()? .success(); if !success { - return Err(err_msg("Editor failed!")) + return Err(anyhow!("Editor failed!")) } rt.store() |