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 33
33
//! These tasks are not parallelized (they haven't been a bottleneck yet), and
34
34
//! both occur before the crate is rendered.
35
35
36
- use std:: cell:: Cell ;
37
36
use std:: comm:: { SharedPort , SharedChan } ;
38
37
use std:: comm;
39
38
use std:: fmt;
@@ -814,9 +813,9 @@ impl Context {
814
813
// recurse into the items of the module as well.
815
814
clean:: ModuleItem ( ..) => {
816
815
let name = item. name . get_ref ( ) . to_owned ( ) ;
817
- let item = Cell :: new ( item) ;
816
+ let mut item = Some ( item) ;
818
817
self . recurse ( name, |this| {
819
- let item = item. take ( ) ;
818
+ let item = item. take_unwrap ( ) ;
820
819
let dst = this. dst . join ( "index.html" ) ;
821
820
render ( File :: create ( & dst) . unwrap ( ) , this, & item, false ) ;
822
821
Original file line number Diff line number Diff line change @@ -646,7 +646,6 @@ impl Drop for UdpWatcher {
646
646
647
647
#[ cfg( test) ]
648
648
mod test {
649
- use std:: cell:: Cell ;
650
649
use std:: comm:: oneshot;
651
650
use std:: rt:: test:: * ;
652
651
use std:: rt:: rtio:: { RtioTcpStream , RtioTcpListener , RtioTcpAcceptor ,
@@ -1071,7 +1070,7 @@ mod test {
1071
1070
1072
1071
let handle1 = sched1.make_handle();
1073
1072
let handle2 = sched2.make_handle();
1074
- let tasksFriendHandle = Cell::new( sched2.make_handle() );
1073
+ let tasksFriendHandle = sched2.make_handle();
1075
1074
1076
1075
let on_exit: proc(UnwindResult) = proc(exit_status) {
1077
1076
handle1.send(Shutdown);
@@ -1095,11 +1094,13 @@ mod test {
1095
1094
1096
1095
// block self on sched1
1097
1096
let scheduler: ~Scheduler = Local::take();
1097
+ let mut tasksFriendHandle = Some(tasksFriendHandle);
1098
1098
scheduler.deschedule_running_task_and_then(|_, task| {
1099
1099
// unblock task
1100
1100
task.wake().map(|task| {
1101
1101
// send self to sched2
1102
- tasksFriendHandle.take().send(TaskFromFriend(task));
1102
+ tasksFriendHandle.take_unwrap()
1103
+ .send(TaskFromFriend(task));
1103
1104
});
1104
1105
// sched1 should now sleep since it has nothing else to do
1105
1106
})
You can’t perform that action at this time.
0 commit comments