aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlcollection.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-11-30 13:45:10 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2016-12-01 11:55:12 +0100
commita377caa7e9d68a97156b968964bb7bc18444d13d (patch)
tree641565a14fcfa891e2052797b8af32f0495305b0 /components/script/dom/htmlcollection.rs
parent2fcb908daa694c31d5851f03b8d52c938a9c1304 (diff)
downloadservo-a377caa7e9d68a97156b968964bb7bc18444d13d.tar.gz
servo-a377caa7e9d68a97156b968964bb7bc18444d13d.zip
Make Element::prefix return an Option<&DOMString>
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r--components/script/dom/htmlcollection.rs8
1 files changed, 4 insertions, 4 deletions
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()),
}
}