about summary refs log tree commit diff
path: root/src/libstd/task
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2013-06-04 12:03:58 +0200
committerPhilipp Brüschweiler <blei42@gmail.com>2013-06-04 12:03:58 +0200
commit34ee63e93bd763326e676bd634f6f17a8f77791d (patch)
tree844bf025d2763daf4913cd7ae965803c20e0e2a3 /src/libstd/task
parent133d45171564c8b7de14523c9f3aa87140b9f043 (diff)
downloadrust-34ee63e93bd763326e676bd634f6f17a8f77791d.tar.gz
rust-34ee63e93bd763326e676bd634f6f17a8f77791d.zip
std::cell: Modernize constructors
Part of #3853
Diffstat (limited to 'src/libstd/task')
-rw-r--r--src/libstd/task/mod.rs12
-rw-r--r--src/libstd/task/spawn.rs4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs
index 7c9639bb8f3..223afbce091 100644
--- a/src/libstd/task/mod.rs
+++ b/src/libstd/task/mod.rs
@@ -308,7 +308,7 @@ impl TaskBuilder {
                 f
             }
         };
-        let prev_gen_body = Cell(prev_gen_body);
+        let prev_gen_body = Cell::new(prev_gen_body);
         let next_gen_body = {
             let f: ~fn(~fn()) -> ~fn() = |body| {
                 let prev_gen_body = prev_gen_body.take();
@@ -354,7 +354,7 @@ impl TaskBuilder {
 
     /// Runs a task, while transfering ownership of one argument to the child.
     pub fn spawn_with<A:Owned>(&mut self, arg: A, f: ~fn(v: A)) {
-        let arg = Cell(arg);
+        let arg = Cell::new(arg);
         do self.spawn {
             f(arg.take());
         }
@@ -791,9 +791,9 @@ struct Wrapper {
 fn test_add_wrapper() {
     let (po, ch) = stream::<()>();
     let mut b0 = task();
-    let ch = Cell(ch);
+    let ch = Cell::new(ch);
     do b0.add_wrapper |body| {
-        let ch = Cell(ch.take());
+        let ch = Cell::new(ch.take());
         let result: ~fn() = || {
             let ch = ch.take();
             body();
@@ -890,10 +890,10 @@ fn test_spawn_sched_childs_on_default_sched() {
     // Assuming tests run on the default scheduler
     let default_id = unsafe { rt::rust_get_sched_id() };
 
-    let ch = Cell(ch);
+    let ch = Cell::new(ch);
     do spawn_sched(SingleThreaded) {
         let parent_sched_id = unsafe { rt::rust_get_sched_id() };
-        let ch = Cell(ch.take());
+        let ch = Cell::new(ch.take());
         do spawn {
             let ch = ch.take();
             let child_sched_id = unsafe { rt::rust_get_sched_id() };
diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs
index 35cf6de3a15..87e9296657f 100644
--- a/src/libstd/task/spawn.rs
+++ b/src/libstd/task/spawn.rs
@@ -594,7 +594,7 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
         gen_child_taskgroup(opts.linked, opts.supervised);
 
     unsafe {
-        let child_data = Cell((child_tg, ancestors, f));
+        let child_data = Cell::new((child_tg, ancestors, f));
         // Being killed with the unsafe task/closure pointers would leak them.
         do unkillable {
             // Agh. Get move-mode items into the closure. FIXME (#2829)
@@ -636,7 +636,7 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
                           notify_chan: Option<Chan<TaskResult>>,
                           f: ~fn())
                        -> ~fn() {
-        let child_data = Cell((child_arc, ancestors));
+        let child_data = Cell::new((child_arc, ancestors));
         let result: ~fn() = || {
             // Agh. Get move-mode items into the closure. FIXME (#2829)
             let mut (child_arc, ancestors) = child_data.take();