Use question_mark feature in libstd.
This commit is contained in:
parent
d73e374ddb
commit
637f1492e7
@ -150,7 +150,7 @@ impl<T> Packet<T> {
|
||||
let timed_out = !wait_token.wait_max_until(deadline);
|
||||
// Try to reset the state
|
||||
if timed_out {
|
||||
try!(self.abort_selection().map_err(Upgraded));
|
||||
self.abort_selection().map_err(Upgraded)?;
|
||||
}
|
||||
} else {
|
||||
wait_token.wait();
|
||||
|
@ -187,8 +187,7 @@ impl<T> Packet<T> {
|
||||
if let Some(deadline) = deadline {
|
||||
let timed_out = !wait_token.wait_max_until(deadline);
|
||||
if timed_out {
|
||||
try!(self.abort_selection(/* was_upgrade = */ false)
|
||||
.map_err(Upgraded));
|
||||
self.abort_selection(/* was_upgrade = */ false).map_err(Upgraded)?;
|
||||
}
|
||||
} else {
|
||||
wait_token.wait();
|
||||
|
@ -153,11 +153,11 @@ pub fn demangle(writer: &mut Write, s: &str) -> io::Result<()> {
|
||||
macro_rules! demangle {
|
||||
($($pat:expr => $demangled:expr),*) => ({
|
||||
$(if rest.starts_with($pat) {
|
||||
try!(writer.write_all($demangled));
|
||||
writer.write_all($demangled)?;
|
||||
rest = &rest[$pat.len()..];
|
||||
} else)*
|
||||
{
|
||||
try!(writer.write_all(rest.as_bytes()));
|
||||
writer.write_all(rest.as_bytes())?;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user