librustdoc: Remove a couple of Cell
s.
This commit is contained in:
parent
ebe8ac88a7
commit
9a6ebbbecc
@ -33,7 +33,6 @@
|
||||
//! These tasks are not parallelized (they haven't been a bottleneck yet), and
|
||||
//! both occur before the crate is rendered.
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::comm::{SharedPort, SharedChan};
|
||||
use std::comm;
|
||||
use std::fmt;
|
||||
@ -814,9 +813,9 @@ fn render(w: io::File, cx: &mut Context, it: &clean::Item,
|
||||
// recurse into the items of the module as well.
|
||||
clean::ModuleItem(..) => {
|
||||
let name = item.name.get_ref().to_owned();
|
||||
let item = Cell::new(item);
|
||||
let mut item = Some(item);
|
||||
self.recurse(name, |this| {
|
||||
let item = item.take();
|
||||
let item = item.take_unwrap();
|
||||
let dst = this.dst.join("index.html");
|
||||
render(File::create(&dst).unwrap(), this, &item, false);
|
||||
|
||||
|
@ -646,7 +646,6 @@ fn drop(&mut self) {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::cell::Cell;
|
||||
use std::comm::oneshot;
|
||||
use std::rt::test::*;
|
||||
use std::rt::rtio::{RtioTcpStream, RtioTcpListener, RtioTcpAcceptor,
|
||||
@ -1071,7 +1070,7 @@ fn test_simple_homed_udp_io_bind_then_move_task_then_home_and_close() {
|
||||
|
||||
let handle1 = sched1.make_handle();
|
||||
let handle2 = sched2.make_handle();
|
||||
let tasksFriendHandle = Cell::new(sched2.make_handle());
|
||||
let tasksFriendHandle = sched2.make_handle();
|
||||
|
||||
let on_exit: proc(UnwindResult) = proc(exit_status) {
|
||||
handle1.send(Shutdown);
|
||||
@ -1095,11 +1094,13 @@ unsafe fn local_io() -> &'static mut IoFactory {
|
||||
|
||||
// block self on sched1
|
||||
let scheduler: ~Scheduler = Local::take();
|
||||
let mut tasksFriendHandle = Some(tasksFriendHandle);
|
||||
scheduler.deschedule_running_task_and_then(|_, task| {
|
||||
// unblock task
|
||||
task.wake().map(|task| {
|
||||
// send self to sched2
|
||||
tasksFriendHandle.take().send(TaskFromFriend(task));
|
||||
tasksFriendHandle.take_unwrap()
|
||||
.send(TaskFromFriend(task));
|
||||
});
|
||||
// sched1 should now sleep since it has nothing else to do
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user