diff options
| author | bors <bors@rust-lang.org> | 2014-08-28 23:56:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-28 23:56:20 +0000 |
| commit | 2e92c67dc0318a52fe42c3c0bca408f76c7feb61 (patch) | |
| tree | 1a90b5802f53f36eda0212ac1b02ebd521161f25 /src/libsync/comm | |
| parent | 1a33d7a54170cd2904cebc7a6fd2d1da471ff64e (diff) | |
| parent | 9a8233d3772fbdb3d496aac3e4693e6d4c30e125 (diff) | |
| download | rust-2e92c67dc0318a52fe42c3c0bca408f76c7feb61.tar.gz rust-2e92c67dc0318a52fe42c3c0bca408f76c7feb61.zip | |
auto merge of #16664 : aturon/rust/stabilize-option-result, r=alexcrichton
Per API meeting https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-13.md # Changes to `core::option` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. However, a few methods have been deprecated, either due to lack of use or redundancy: * `take_unwrap`, `get_ref` and `get_mut_ref` (redundant, and we prefer for this functionality to go through an explicit .unwrap) * `filtered` and `while` * `mutate` and `mutate_or_set` * `collect`: this functionality is being moved to a new `FromIterator` impl. # Changes to `core::result` Most of the module is marked as stable or unstable; most of the unstable items are awaiting resolution of conventions issues. * `collect`: this functionality is being moved to a new `FromIterator` impl. * `fold_` is deprecated due to lack of use * Several methods found in `core::option` are added here, including `iter`, `as_slice`, and variants. Due to deprecations, this is a: [breaking-change]
Diffstat (limited to 'src/libsync/comm')
| -rw-r--r-- | src/libsync/comm/oneshot.rs | 4 | ||||
| -rw-r--r-- | src/libsync/comm/sync.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libsync/comm/oneshot.rs b/src/libsync/comm/oneshot.rs index 188bea83ac8..5b3cf33ebf0 100644 --- a/src/libsync/comm/oneshot.rs +++ b/src/libsync/comm/oneshot.rs @@ -107,7 +107,7 @@ impl<T: Send> Packet<T> { // Couldn't send the data, the port hung up first. Return the data // back up the stack. DISCONNECTED => { - Err(self.data.take_unwrap()) + Err(self.data.take().unwrap()) } // Not possible, these are one-use channels @@ -244,7 +244,7 @@ impl<T: Send> Packet<T> { // There's data on the channel, so make sure we destroy it promptly. // This is why not using an arc is a little difficult (need the box // to stay valid while we take the data). - DATA => { self.data.take_unwrap(); } + DATA => { self.data.take().unwrap(); } // We're the only ones that can block on this port _ => unreachable!() diff --git a/src/libsync/comm/sync.rs b/src/libsync/comm/sync.rs index 1ee9fef1918..528a15cf6d7 100644 --- a/src/libsync/comm/sync.rs +++ b/src/libsync/comm/sync.rs @@ -347,7 +347,7 @@ impl<T: Send> Packet<T> { let waiter = match mem::replace(&mut state.blocker, NoneBlocked) { NoneBlocked => None, BlockedSender(task) => { - *state.canceled.take_unwrap() = true; + *state.canceled.take().unwrap() = true; Some(task) } BlockedReceiver(..) => unreachable!(), @@ -434,7 +434,7 @@ impl<T> Buffer<T> { let start = self.start; self.size -= 1; self.start = (self.start + 1) % self.buf.len(); - self.buf.get_mut(start).take_unwrap() + self.buf.get_mut(start).take().unwrap() } fn size(&self) -> uint { self.size } @@ -481,7 +481,7 @@ impl Queue { } unsafe { (*node).next = 0 as *mut Node; - Some((*node).task.take_unwrap()) + Some((*node).task.take().unwrap()) } } } |
