diff options
author | Jack Moffitt <jack@metajack.im> | 2014-06-27 19:25:07 -0600 |
---|---|---|
committer | Jack Moffitt <jack@metajack.im> | 2014-06-27 19:25:07 -0600 |
commit | 52b5d2575c80d863e0c26143eefbce785cb0181a (patch) | |
tree | 2c0f5a6ebc85a487a6f72976f021b555ce593da8 /src/components/script/dom/node.rs | |
parent | 491cc03c3a182d0bbc77123e5bc5a9995a4f8f78 (diff) | |
parent | f5b5b337d3fd5eb6632e3133486e16eeea7566a5 (diff) | |
download | servo-52b5d2575c80d863e0c26143eefbce785cb0181a.tar.gz servo-52b5d2575c80d863e0c26143eefbce785cb0181a.zip |
Merge pull request #2725 from metajack/rustup-20140624
Upgrade to latest Rust.
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r-- | src/components/script/dom/node.rs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index e67fe0eda2f..def4ee6248d 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -172,12 +172,6 @@ impl LayoutDataRef { } } - pub unsafe fn from_data<T>(data: Box<T>) -> LayoutDataRef { - LayoutDataRef { - data_cell: RefCell::new(Some(mem::transmute(data))), - } - } - /// Returns true if there is layout data present. #[inline] pub fn is_present(&self) -> bool { @@ -225,7 +219,7 @@ impl LayoutDataRef { pub trait TLayoutData {} /// The different types of nodes. -#[deriving(Eq,Encodable)] +#[deriving(PartialEq,Encodable)] pub enum NodeTypeId { DoctypeNodeTypeId, DocumentFragmentNodeTypeId, @@ -901,7 +895,7 @@ fn gather_abstract_nodes<'a>(cur: &JSRef<'a, Node>, refs: &mut Vec<JSRef<'a, Nod } /// Specifies whether children must be recursively cloned or not. -#[deriving(Eq)] +#[deriving(PartialEq)] pub enum CloneChildrenFlag { CloneChildren, DoNotCloneChildren @@ -1024,13 +1018,13 @@ impl Node { if node.children().any(|c| c.is_text()) { return Err(HierarchyRequest); } - match node.child_elements().len() { + match node.child_elements().count() { 0 => (), // Step 6.1.2 1 => { // FIXME: change to empty() when https://github.com/mozilla/rust/issues/11218 // will be fixed - if parent.child_elements().len() > 0 { + if parent.child_elements().count() > 0 { return Err(HierarchyRequest); } match child { @@ -1049,7 +1043,7 @@ impl Node { ElementNodeTypeId(_) => { // FIXME: change to empty() when https://github.com/mozilla/rust/issues/11218 // will be fixed - if parent.child_elements().len() > 0 { + if parent.child_elements().count() > 0 { return Err(HierarchyRequest); } match child { @@ -1076,7 +1070,7 @@ impl Node { None => { // FIXME: change to empty() when https://github.com/mozilla/rust/issues/11218 // will be fixed - if parent.child_elements().len() > 0 { + if parent.child_elements().count() > 0 { return Err(HierarchyRequest); } }, @@ -1649,7 +1643,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> { if node.children().any(|c| c.is_text()) { return Err(HierarchyRequest); } - match node.child_elements().len() { + match node.child_elements().count() { 0 => (), // Step 6.1.2 1 => { @@ -1837,7 +1831,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // Step 5. - if this.children().len() != node.children().len() { + if this.children().count() != node.children().count() { return false; } @@ -1953,9 +1947,9 @@ pub fn window_from_node<T: NodeBase>(derived: &JSRef<T>) -> Temporary<Window> { } impl<'a> VirtualMethods for JSRef<'a, Node> { - fn super_type<'a>(&'a self) -> Option<&'a VirtualMethods:> { + fn super_type<'a>(&'a self) -> Option<&'a VirtualMethods+> { let eventtarget: &JSRef<EventTarget> = EventTargetCast::from_ref(self); - Some(eventtarget as &VirtualMethods:) + Some(eventtarget as &VirtualMethods+) } } |