From d60f7d72e6229bb5ed0005923f30923d66f2f2a0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Oct 2017 20:17:21 +0100 Subject: [PATCH] Replace uses of try!() macro with "?" operator --- lib/entry/libimagentrylist/src/listers/line.rs | 2 +- lib/entry/libimagentrylist/src/listers/path.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/entry/libimagentrylist/src/listers/line.rs b/lib/entry/libimagentrylist/src/listers/line.rs index b4c2639b..8f89e66e 100644 --- a/lib/entry/libimagentrylist/src/listers/line.rs +++ b/lib/entry/libimagentrylist/src/listers/line.rs @@ -47,7 +47,7 @@ impl<'a> Lister for LineLister<'a> { for entry in entries { let s = entry.get_location().to_str().unwrap_or(String::from(self.unknown_output)); - try!(write!(stdout(), "{:?}\n", s).chain_err(|| LEK::FormatError)) + write!(stdout(), "{:?}\n", s).chain_err(|| LEK::FormatError)? } Ok(()) diff --git a/lib/entry/libimagentrylist/src/listers/path.rs b/lib/entry/libimagentrylist/src/listers/path.rs index f45239d6..b88d43fa 100644 --- a/lib/entry/libimagentrylist/src/listers/path.rs +++ b/lib/entry/libimagentrylist/src/listers/path.rs @@ -47,14 +47,14 @@ impl Lister for PathLister { for entry in entries { let pb = entry.get_location().clone(); - let pb = try!(pb.into_pathbuf().chain_err(|| LEK::FormatError)); + let pb = pb.into_pathbuf().chain_err(|| LEK::FormatError)?; let pb = if self.absolute { - try!(pb.canonicalize().chain_err(|| LEK::FormatError)) + pb.canonicalize().chain_err(|| LEK::FormatError)? } else { pb.into() }; - try!(write!(stdout(), "{:?}\n", pb).chain_err(|| LEK::FormatError)) + write!(stdout(), "{:?}\n", pb).chain_err(|| LEK::FormatError)? } Ok(())