mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Use util::str::str_join in more places
Instead of intermediate allocations of `Vec`s, we should utilize `str_join` which operates on iterators
This commit is contained in:
parent
2857e547be
commit
f14f09e886
4 changed files with 7 additions and 10 deletions
|
@ -15,11 +15,10 @@ use selectors::parser::PseudoElement;
|
|||
use std::ascii::AsciiExt;
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::Ref;
|
||||
use std::slice::SliceConcatExt;
|
||||
use string_cache::Atom;
|
||||
use style::properties::PropertyDeclaration;
|
||||
use style::properties::{is_supported_property, longhands_from_shorthand, parse_one_declaration};
|
||||
use util::str::DOMString;
|
||||
use util::str::{DOMString, str_join};
|
||||
|
||||
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
|
||||
#[dom_struct]
|
||||
|
@ -50,8 +49,8 @@ macro_rules! css_properties(
|
|||
);
|
||||
|
||||
fn serialize_list(list: &[Ref<PropertyDeclaration>]) -> DOMString {
|
||||
let strings: Vec<_> = list.iter().map(|d| d.value()).collect();
|
||||
strings.join(" ")
|
||||
let str_iter = list.iter().map(|d| d.value());
|
||||
str_join(str_iter, " ")
|
||||
}
|
||||
|
||||
impl CSSStyleDeclaration {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue