diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-06-10 15:07:33 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-06-11 19:51:07 +0200 |
commit | 288e0bc877aa09a95f440c603eddbaf166e8f592 (patch) | |
tree | 587a31c3308935abbba1a54ff23b518dfcec6dc3 /src/components/script/html/hubbub_html_parser.rs | |
parent | d230077f9f269d8f46af07004dd659496f701044 (diff) | |
download | servo-288e0bc877aa09a95f440c603eddbaf166e8f592.tar.gz servo-288e0bc877aa09a95f440c603eddbaf166e8f592.zip |
Use internal mutability for CharacterData::data.
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 23247341325..c7629958d33 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -506,17 +506,17 @@ pub fn parse_html(page: &Page, js_chan2.send(JSTaskNewFile(new_url)); } None => { - let mut data = vec!(); + let mut data = String::new(); let scriptnode: &JSRef<Node> = NodeCast::from_ref(script); debug!("iterating over children {:?}", scriptnode.first_child()); for child in scriptnode.children() { debug!("child = {:?}", child); let text: &JSRef<Text> = TextCast::to_ref(&child).unwrap(); - data.push(text.deref().characterdata.data.to_str()); // FIXME: Bad copy. + data.push_str(text.deref().characterdata.data.deref().borrow().as_slice()); } debug!("script data = {:?}", data); - js_chan2.send(JSTaskNewInlineScript(data.concat(), url3.clone())); + js_chan2.send(JSTaskNewInlineScript(data, url3.clone())); } } } |