Convert a method from &JSRef to JSRef

This also removes the unnecessary formation of a trait object.
This commit is contained in:
Cameron Zwarich 2014-09-27 20:43:39 -07:00
parent 698b916c09
commit 3953456b61
2 changed files with 4 additions and 5 deletions

View file

@ -2086,8 +2086,7 @@ impl<'a> style::TNode<'a, JSRef<'a, Element>> for JSRef<'a, Node> {
fn is_html_element_in_html_document(&self) -> bool {
let elem: Option<JSRef<'a, Element>> = ElementCast::to_ref(*self);
assert!(elem.is_some());
let elem: &ElementHelpers = &elem.unwrap() as &ElementHelpers;
elem.html_element_in_html_document()
elem.unwrap().html_element_in_html_document()
}
}