diff options
| author | Philipp Brüschweiler <blei42@gmail.com> | 2013-06-04 12:03:58 +0200 |
|---|---|---|
| committer | Philipp Brüschweiler <blei42@gmail.com> | 2013-06-04 12:03:58 +0200 |
| commit | 34ee63e93bd763326e676bd634f6f17a8f77791d (patch) | |
| tree | 844bf025d2763daf4913cd7ae965803c20e0e2a3 /src/libstd/rt/sched.rs | |
| parent | 133d45171564c8b7de14523c9f3aa87140b9f043 (diff) | |
| download | rust-34ee63e93bd763326e676bd634f6f17a8f77791d.tar.gz rust-34ee63e93bd763326e676bd634f6f17a8f77791d.zip | |
std::cell: Modernize constructors
Part of #3853
Diffstat (limited to 'src/libstd/rt/sched.rs')
| -rw-r--r-- | src/libstd/rt/sched.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index 064eb63afc6..929b44f79b5 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -146,7 +146,7 @@ impl Scheduler { rtdebug!("ending running task"); do self.deschedule_running_task_and_then |dead_task| { - let dead_task = Cell(dead_task); + let dead_task = Cell::new(dead_task); do Local::borrow::<Scheduler> |sched| { dead_task.take().recycle(&mut sched.stack_pool); } @@ -159,7 +159,7 @@ impl Scheduler { assert!(self.in_task_context()); do self.switch_running_tasks_and_then(task) |last_task| { - let last_task = Cell(last_task); + let last_task = Cell::new(last_task); do Local::borrow::<Scheduler> |sched| { sched.enqueue_task(last_task.take()); } @@ -170,7 +170,7 @@ impl Scheduler { assert!(self.in_task_context()); do self.switch_running_tasks_and_then(task) |last_task| { - let last_task = Cell(last_task); + let last_task = Cell::new(last_task); do Local::borrow::<Scheduler> |sched| { sched.enqueue_task(last_task.take()); } @@ -462,7 +462,7 @@ mod test { }; // Context switch directly to the new task do sched.switch_running_tasks_and_then(task2) |task1| { - let task1 = Cell(task1); + let task1 = Cell::new(task1); do Local::borrow::<Scheduler> |sched| { sched.enqueue_task(task1.take()); } @@ -516,7 +516,7 @@ mod test { let sched = Local::take::<Scheduler>(); assert!(sched.in_task_context()); do sched.deschedule_running_task_and_then() |task| { - let task = Cell(task); + let task = Cell::new(task); do Local::borrow::<Scheduler> |sched| { assert!(!sched.in_task_context()); sched.enqueue_task(task.take()); @@ -539,7 +539,7 @@ mod test { let sched = Local::take::<Scheduler>(); do sched.deschedule_running_task_and_then |task| { let mut sched = Local::take::<Scheduler>(); - let task = Cell(task); + let task = Cell::new(task); do sched.event_loop.callback_ms(10) { rtdebug!("in callback"); let mut sched = Local::take::<Scheduler>(); |
