From a377caa7e9d68a97156b968964bb7bc18444d13d Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Wed, 30 Nov 2016 13:45:10 +0100 Subject: Make Element::prefix return an Option<&DOMString> --- components/script/dom/htmlcollection.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'components/script/dom/htmlcollection.rs') diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index 71fc6a1ecf1..959265e82e0 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -151,11 +151,11 @@ impl HTMLCollection { } fn match_element(elem: &Element, qualified_name: &LocalName) -> bool { - match *elem.prefix() { + match elem.prefix() { None => elem.local_name() == qualified_name, - Some(ref prefix) => qualified_name.starts_with(prefix as &str) && - qualified_name.find(":") == Some((prefix as &str).len()) && - qualified_name.ends_with(elem.local_name() as &str), + Some(prefix) => qualified_name.starts_with(&**prefix) && + qualified_name.find(":") == Some(prefix.len()) && + qualified_name.ends_with(&**elem.local_name()), } } -- cgit v1.2.3