From 8f58dafbd6e6d0b714a00bb0e3285b4617ecf111 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sun, 21 Jun 2015 15:20:47 +0200 Subject: [PATCH] Inline node_is_element and node_is_document into their only callers. --- components/layout/wrapper.rs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 3fc7a3aa0b3..341816840d8 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -89,20 +89,6 @@ pub trait TLayoutNode { /// call and as such is marked `unsafe`. unsafe fn get_jsmanaged<'a>(&'a self) -> &'a LayoutJS; - fn node_is_element(&self) -> bool { - match self.type_id() { - Some(NodeTypeId::Element(..)) => true, - _ => false - } - } - - fn node_is_document(&self) -> bool { - match self.type_id() { - Some(NodeTypeId::Document(..)) => true, - _ => false - } - } - /// If this is an image element, returns its URL. If this is not an image element, fails. /// /// FIXME(pcwalton): Don't copy URLs. @@ -358,11 +344,17 @@ impl<'ln> TNode for LayoutNode<'ln> { } fn is_element(&self) -> bool { - self.node_is_element() + match self.type_id() { + Some(NodeTypeId::Element(..)) => true, + _ => false + } } fn is_document(&self) -> bool { - self.node_is_document() + match self.type_id() { + Some(NodeTypeId::Document(..)) => true, + _ => false + } } fn match_attr(&self, attr: &AttrSelector, test: F) -> bool where F: Fn(&str) -> bool {