Replace uses of try!() macro with "?" operator
This commit is contained in:
parent
da391954cc
commit
d60f7d72e6
2 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ impl<'a> Lister for LineLister<'a> {
|
||||||
|
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
let s = entry.get_location().to_str().unwrap_or(String::from(self.unknown_output));
|
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(())
|
Ok(())
|
||||||
|
|
|
@ -47,14 +47,14 @@ impl Lister for PathLister {
|
||||||
|
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
let pb = entry.get_location().clone();
|
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 {
|
let pb = if self.absolute {
|
||||||
try!(pb.canonicalize().chain_err(|| LEK::FormatError))
|
pb.canonicalize().chain_err(|| LEK::FormatError)?
|
||||||
} else {
|
} else {
|
||||||
pb.into()
|
pb.into()
|
||||||
};
|
};
|
||||||
|
|
||||||
try!(write!(stdout(), "{:?}\n", pb).chain_err(|| LEK::FormatError))
|
write!(stdout(), "{:?}\n", pb).chain_err(|| LEK::FormatError)?
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue