diff options
| author | Ahmed Charles <acharles@outlook.com> | 2016-08-27 07:33:36 -0700 |
|---|---|---|
| committer | Ahmed Charles <acharles@outlook.com> | 2016-09-11 16:02:44 -0700 |
| commit | 637f1492e7beb768c039b962fb04b6855d6e9461 (patch) | |
| tree | 5c9cb93cef91575d77d24c9a3af3e7fbd033dc4a /src/libstd/sync | |
| parent | d73e374ddbf66489c0565566d26e659e6ff80c2c (diff) | |
| download | rust-637f1492e7beb768c039b962fb04b6855d6e9461.tar.gz rust-637f1492e7beb768c039b962fb04b6855d6e9461.zip | |
Use question_mark feature in libstd.
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/oneshot.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/stream.rs | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs index 7a35ea6bbaa..7389280b853 100644 --- a/src/libstd/sync/mpsc/oneshot.rs +++ b/src/libstd/sync/mpsc/oneshot.rs @@ -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(); diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs index aa1254c8641..61c8316467d 100644 --- a/src/libstd/sync/mpsc/stream.rs +++ b/src/libstd/sync/mpsc/stream.rs @@ -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(); |
