diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index d32a47a8ab52..734eb0af8fe1 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -18,10 +18,10 @@ fn empty_cell() -> Cell { impl Cell { /// Yields the value, failing if the cell is empty. fn take() -> T { - let value = none; + let mut value = none; value <-> self.value; if value.is_none() { - fail "attempt to take an empty cell"; + fail ~"attempt to take an empty cell"; } return option::unwrap(value); } @@ -29,7 +29,7 @@ impl Cell { /// Returns the value, failing if the cell is full. fn put_back(+value: T) { if self.value.is_none() { - fail "attempt to put a value back into a full cell"; + fail ~"attempt to put a value back into a full cell"; } self.value = some(move value); } @@ -39,4 +39,3 @@ impl Cell { self.value.is_none() } } - diff --git a/src/libstd/std.rc b/src/libstd/std.rc index dfc659781dea..b2d9d3770fc9 100644 --- a/src/libstd/std.rc +++ b/src/libstd/std.rc @@ -26,6 +26,7 @@ export ebml, dbg, getopts, json, rand, sha1, term, time, prettyprint; export test, tempfile, serialization; export cmp; export base64; +export cell; // General io and system-services modules @@ -45,6 +46,7 @@ mod uv_global_loop; mod c_vec; mod timer; +mod cell; // Concurrency