diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2015-08-27 02:27:42 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-08-27 02:27:42 +0530 |
commit | 4678ec16bb7e3aa242f30d6a9d675d5aeaec7cf7 (patch) | |
tree | d495d9e4171c209393e9b9adb645a4cfb9cd0f3a /components/script/dom/element.rs | |
parent | b33c5427bc350e42503e2de1a8f832c63522b2d0 (diff) | |
download | servo-4678ec16bb7e3aa242f30d6a9d675d5aeaec7cf7.tar.gz servo-4678ec16bb7e3aa242f30d6a9d675d5aeaec7cf7.zip |
remove to_borrowed_ref, fix Activatable
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index d4f56c13084..b0f28f62cab 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1854,7 +1854,7 @@ impl<'a> ::selectors::Element for Root<Element> { } pub trait ActivationElementHelpers<'a> { - fn as_maybe_activatable(&'a self) -> Option<&'a (Activatable + 'a)>; + fn as_maybe_activatable(self) -> Option<&'a (Activatable + 'a)>; fn click_in_progress(self) -> bool; fn set_click_in_progress(self, click: bool); fn nearest_activable_element(self) -> Option<Root<Element>>; @@ -1862,15 +1862,15 @@ pub trait ActivationElementHelpers<'a> { } impl<'a> ActivationElementHelpers<'a> for &'a Element { - fn as_maybe_activatable(&'a self) -> Option<&'a (Activatable + 'a)> { - let node = NodeCast::from_ref(*self); + fn as_maybe_activatable(self) -> Option<&'a (Activatable + 'a)> { + let node = NodeCast::from_ref(self); let element = match node.type_id() { NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) => { - let element = HTMLInputElementCast::to_borrowed_ref(self).unwrap(); + let element = HTMLInputElementCast::to_ref(self).unwrap(); Some(element as &'a (Activatable + 'a)) }, NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) => { - let element = HTMLAnchorElementCast::to_borrowed_ref(self).unwrap(); + let element = HTMLAnchorElementCast::to_ref(self).unwrap(); Some(element as &'a (Activatable + 'a)) }, _ => { |