about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-06-21 14:09:39 -0700
committerEric Holk <eric.holk@gmail.com>2012-06-21 16:11:11 -0700
commit28ab0e8c0335544359d1809a40682f38c9610b78 (patch)
tree16b518f1c63957f41a2b67811634cc08bed94fc8
parent40559ea83961df06c82f76c333ce4c9604f12449 (diff)
downloadrust-28ab0e8c0335544359d1809a40682f38c9610b78.tar.gz
rust-28ab0e8c0335544359d1809a40682f38c9610b78.zip
Fixing illegal moves.
-rw-r--r--src/libcore/newcomm.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libcore/newcomm.rs b/src/libcore/newcomm.rs
index 6934dba84cd..24c4c1cbd9c 100644
--- a/src/libcore/newcomm.rs
+++ b/src/libcore/newcomm.rs
@@ -34,14 +34,8 @@ fn send<T: send>(c: chan<T>, -x: T) {
     (*c).with {|cond, data|
         let mut xx = none;
         xx <-> x;
-        alt xx {
-          some(y) {
-            let mut x <- y;
-            (*data).push(x);
-            cond.signal();
-          }
-          none { fail }
-        };
+        (*data).push(option::unwrap(xx));
+        cond.signal();
     }
 }