Replace uses of try!() macro with "?" operator

This commit is contained in:
Matthias Beyer 2017-10-30 20:17:21 +01:00
parent da391954cc
commit d60f7d72e6
2 changed files with 4 additions and 4 deletions

View file

@ -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(())

View file

@ -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(())