diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-12-05 15:00:54 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-12-08 12:03:12 +0100 |
commit | 1611b8d0a808968d32d1f30556fecdbeb1d137b7 (patch) | |
tree | 99b42fc4931881d85fc1f89bda4e7f0adc6e40fb /components/script/dom/node.rs | |
parent | 54c0601950ac862d8f4dbf30a31df9ca6a676c9a (diff) | |
download | servo-1611b8d0a808968d32d1f30556fecdbeb1d137b7.tar.gz servo-1611b8d0a808968d32d1f30556fecdbeb1d137b7.zip |
Cleanup Node::summarize.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 9f6605569da..ad8624718ab 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -848,11 +848,9 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> { publicId: "".to_string(), systemId: "".to_string(), - attrs: if self.is_element() { - let elem: JSRef<Element> = ElementCast::to_ref(self).unwrap(); - elem.summarize() - } else { - vec!() + attrs: match ElementCast::to_ref(self) { + Some(element) => element.summarize(), + None => vec!(), }, isDocumentElement: |