diff options
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r-- | components/script/dom/attr.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 0c8e92f7d42..a8f4b897f15 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -49,7 +49,11 @@ impl AttrValue { } pub fn from_atomic_tokens(atoms: Vec<Atom>) -> AttrValue { - let tokens = atoms.iter().map(|x| &**x).collect::<Vec<_>>().connect("\x20"); + let tokens = atoms.iter().fold(String::new(), |mut s, atom| { + if !s.is_empty() { s.push('\x20'); } + s.push_str(atom); + s + }); AttrValue::TokenList(tokens, atoms) } |