mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +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
|
@ -98,7 +98,7 @@ use std::sync::mpsc::channel;
|
|||
use string_cache::{Atom, QualName};
|
||||
use time;
|
||||
use url::Url;
|
||||
use util::str::{DOMString, split_html_space_chars};
|
||||
use util::str::{DOMString, split_html_space_chars, str_join};
|
||||
|
||||
#[derive(JSTraceable, PartialEq, HeapSizeOf)]
|
||||
pub enum IsHTMLDocument {
|
||||
|
@ -1443,7 +1443,7 @@ impl DocumentMethods for Document {
|
|||
Some(ref title) => {
|
||||
// Steps 3-4.
|
||||
let value = Node::collect_text_contents(title.r().children());
|
||||
split_html_space_chars(&value).collect::<Vec<_>>().join(" ")
|
||||
str_join(split_html_space_chars(&value), " ")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue