aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domtokenlist.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-07-08 05:18:07 +0900
committerCorey Farwell <coreyf@rwell.org>2015-07-08 05:18:07 +0900
commit7159fe749f59931d09cedcffcb3d2ff52432cbcc (patch)
tree5b151f9c95b17e9fcbd7d1066b7c7f467322f7d8 /components/script/dom/domtokenlist.rs
parentc77b5aa8e21a5b18b078c6a8c4eed194800e3901 (diff)
downloadservo-7159fe749f59931d09cedcffcb3d2ff52432cbcc.tar.gz
servo-7159fe749f59931d09cedcffcb3d2ff52432cbcc.zip
Create and utilize utility for joining strs
Diffstat (limited to 'components/script/dom/domtokenlist.rs')
-rw-r--r--components/script/dom/domtokenlist.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs
index f863996e9ca..f7a02cdf572 100644
--- a/components/script/dom/domtokenlist.rs
+++ b/components/script/dom/domtokenlist.rs
@@ -13,7 +13,7 @@ use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::element::{Element, AttributeHandlers};
use dom::node::window_from_node;
-use util::str::{DOMString, HTML_SPACE_CHARACTERS};
+use util::str::{DOMString, HTML_SPACE_CHARACTERS, str_join};
use string_cache::Atom;
use std::borrow::ToOwned;
@@ -158,10 +158,6 @@ impl<'a> DOMTokenListMethods for &'a DOMTokenList {
// https://dom.spec.whatwg.org/#stringification-behavior
fn Stringifier(self) -> DOMString {
let tokenlist = self.element.root().r().get_tokenlist_attribute(&self.local_name);
- tokenlist.iter().fold(String::new(), |mut s, atom| {
- if !s.is_empty() { s.push('\x20'); }
- s.push_str(atom);
- s
- })
+ str_join(&tokenlist, "\x20")
}
}