Cleanup Node::as_element.

This commit is contained in:
Ms2ger 2014-12-05 15:12:47 +01:00
parent ba5a08c106
commit c009bdec4e

View file

@ -2261,9 +2261,7 @@ impl<'a> style::TNode<'a, JSRef<'a, Element>> for JSRef<'a, Node> {
}
fn as_element(self) -> JSRef<'a, Element> {
let elem: Option<JSRef<'a, Element>> = ElementCast::to_ref(self);
assert!(elem.is_some());
elem.unwrap()
ElementCast::to_ref(self).unwrap()
}
fn match_attr(self, attr: &style::AttrSelector, test: |&str| -> bool) -> bool {