Skip to content

Commit

Permalink
Use question_mark feature in libstd.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedcharles committed Sep 11, 2016
1 parent d73e374 commit 637f149
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libstd/sync/mpsc/oneshot.rs
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions src/libstd/sync/mpsc/stream.rs
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/common/backtrace.rs
Expand Up @@ -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;
}

Expand Down

0 comments on commit 637f149

Please sign in to comment.