File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 3333//! These tasks are not parallelized (they haven't been a bottleneck yet), and
3434//! both occur before the crate is rendered.
3535
36- use std:: cell:: Cell ;
3736use std:: comm:: { SharedPort , SharedChan } ;
3837use std:: comm;
3938use std:: fmt;
@@ -814,9 +813,9 @@ impl Context {
814813 // recurse into the items of the module as well.
815814 clean:: ModuleItem ( ..) => {
816815 let name = item. name . get_ref ( ) . to_owned ( ) ;
817- let item = Cell :: new ( item) ;
816+ let mut item = Some ( item) ;
818817 self . recurse ( name, |this| {
819- let item = item. take ( ) ;
818+ let item = item. take_unwrap ( ) ;
820819 let dst = this. dst . join ( "index.html" ) ;
821820 render ( File :: create ( & dst) . unwrap ( ) , this, & item, false ) ;
822821
Original file line number Diff line number Diff line change @@ -646,7 +646,6 @@ impl Drop for UdpWatcher {
646646
647647#[ cfg( test) ]
648648mod test {
649- use std:: cell:: Cell ;
650649 use std:: comm:: oneshot;
651650 use std:: rt:: test:: * ;
652651 use std:: rt:: rtio:: { RtioTcpStream , RtioTcpListener , RtioTcpAcceptor ,
@@ -1071,7 +1070,7 @@ mod test {
10711070
10721071 let handle1 = sched1.make_handle();
10731072 let handle2 = sched2.make_handle();
1074- let tasksFriendHandle = Cell::new( sched2.make_handle() );
1073+ let tasksFriendHandle = sched2.make_handle();
10751074
10761075 let on_exit: proc(UnwindResult) = proc(exit_status) {
10771076 handle1.send(Shutdown);
@@ -1095,11 +1094,13 @@ mod test {
10951094
10961095 // block self on sched1
10971096 let scheduler: ~Scheduler = Local::take();
1097+ let mut tasksFriendHandle = Some(tasksFriendHandle);
10981098 scheduler.deschedule_running_task_and_then(|_, task| {
10991099 // unblock task
11001100 task.wake().map(|task| {
11011101 // send self to sched2
1102- tasksFriendHandle.take().send(TaskFromFriend(task));
1102+ tasksFriendHandle.take_unwrap()
1103+ .send(TaskFromFriend(task));
11031104 });
11041105 // sched1 should now sleep since it has nothing else to do
11051106 })
You can’t perform that action at this time.
0 commit comments