diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-05-06 00:42:54 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-05-10 22:51:06 -0400 |
| commit | 998fececd6516fa07d0cd0a0c4607ddef0bc40f0 (patch) | |
| tree | 9597e6c2f0592136086f722338b95196f71104ec /src/libstd/future.rs | |
| parent | 7d22437ecdc5b52f8517ffde6207347739b26553 (diff) | |
| download | rust-998fececd6516fa07d0cd0a0c4607ddef0bc40f0.tar.gz rust-998fececd6516fa07d0cd0a0c4607ddef0bc40f0.zip | |
Stop using the '<->' operator
Diffstat (limited to 'src/libstd/future.rs')
| -rw-r--r-- | src/libstd/future.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index b1b2fa2cd28..ac23ea1a6e2 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -26,6 +26,7 @@ use core::cell::Cell; use core::comm::{PortOne, oneshot, send_one}; use core::pipes::recv; use core::task; +use core::util::replace; #[doc = "The future type"] #[cfg(stage0)] @@ -77,8 +78,7 @@ pub impl<A> Future<A> { } } { - let mut state = Evaluating; - self.state <-> state; + let state = replace(&mut self.state, Evaluating); match state { Forced(_) | Evaluating => fail!(~"Logic error."), Pending(f) => { @@ -108,8 +108,7 @@ pub impl<A> Future<A> { } } { - let mut state = Evaluating; - self.state <-> state; + let state = replace(&mut self.state, Evaluating); match state { Forced(_) | Evaluating => fail!(~"Logic error."), Pending(f) => { |
