aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/page.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/page.rs')
-rw-r--r--components/script/page.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/components/script/page.rs b/components/script/page.rs
index 979f49f6681..b051e1df891 100644
--- a/components/script/page.rs
+++ b/components/script/page.rs
@@ -31,7 +31,8 @@ use servo_util::geometry;
use servo_util::str::DOMString;
use servo_util::smallvec::SmallVec;
use std::cell::{Cell, Ref, RefMut};
-use std::comm::{channel, Receiver, Empty, Disconnected};
+use std::sync::mpsc::{channel, Receiver};
+use std::sync::mpsc::TryRecvError::{Empty, Disconnected};
use std::mem::replace;
use std::num::Float;
use std::rc::Rc;
@@ -139,7 +140,7 @@ impl Page {
let (rpc_send, rpc_recv) = channel();
let LayoutChan(ref lchan) = layout_chan;
lchan.send(Msg::GetRPC(rpc_send));
- rpc_recv.recv()
+ rpc_recv.recv().unwrap()
};
Page {
id: id,
@@ -196,7 +197,7 @@ impl Page {
.position(|page_tree| page_tree.id == id)
};
match remove_idx {
- Some(idx) => Some(self.children.borrow_mut().remove(idx).unwrap()),
+ Some(idx) => Some(self.children.borrow_mut().remove(idx)),
None => {
self.children
.borrow_mut()
@@ -251,7 +252,9 @@ impl Page {
}
}
-impl Iterator<Rc<Page>> for PageIterator {
+impl Iterator for PageIterator {
+ type Item = Rc<Page>;
+
fn next(&mut self) -> Option<Rc<Page>> {
match self.stack.pop() {
Some(next) => {
@@ -298,7 +301,7 @@ impl Page {
}
pub fn get_url(&self) -> Url {
- self.url().as_ref().unwrap().ref0().clone()
+ self.url().as_ref().unwrap().0.clone()
}
// FIXME(cgaebel): join_layout is racey. What if the compositor triggers a
@@ -353,7 +356,7 @@ impl Page {
Some(root) => root,
};
- debug!("script: performing reflow for goal {}", goal);
+ debug!("script: performing reflow for goal {:?}", goal);
let root: JSRef<Node> = NodeCast::from_ref(root.r());
if !root.get_has_dirty_descendants() {
@@ -361,7 +364,7 @@ impl Page {
return
}
- debug!("script: performing reflow for goal {}", goal);
+ debug!("script: performing reflow for goal {:?}", goal);
// Layout will let us know when it's done.
let (join_chan, join_port) = channel();