diff options
author | Keegan McAllister <kmcallister@mozilla.com> | 2013-09-23 11:40:12 -0700 |
---|---|---|
committer | Keegan McAllister <kmcallister@mozilla.com> | 2013-09-23 14:50:50 -0700 |
commit | 9bd0e2a3ac41ee563981f37567b73ca309216568 (patch) | |
tree | 3227ad63c26f9ddae6520f417e3dbf83d786350d /src | |
parent | 69473b6c9c76c1fdf2c57402fe97b31085df11ea (diff) | |
download | servo-9bd0e2a3ac41ee563981f37567b73ca309216568.tar.gz servo-9bd0e2a3ac41ee563981f37567b73ca309216568.zip |
Remove an unneeded helper function
Diffstat (limited to 'src')
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index fce6ef9dbcb..85bab19b340 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -500,37 +500,31 @@ pub fn parse_html(cx: *JSContext, debug!("encoding change"); }, complete_script: |script| { - // A little function for holding this lint attr - fn complete_script(script: hubbub::NodeDataPtr, - url: Url, - js_chan: SharedChan<JSMessage>) { - unsafe { - let scriptnode: AbstractNode<ScriptView> = NodeWrapping::from_hubbub_node(script); - do scriptnode.with_imm_element |script| { - match script.get_attr("src") { - Some(src) => { - debug!("found script: %s", src); - let new_url = make_url(src.to_str(), Some(url.clone())); - js_chan.send(JSTaskNewFile(new_url)); - } - None => { - let mut data = ~[]; - debug!("iterating over children %?", scriptnode.first_child()); - for child in scriptnode.children() { - debug!("child = %?", child); - do child.with_imm_text() |text| { - data.push(text.element.data.to_str()); // FIXME: Bad copy. - } + unsafe { + let scriptnode: AbstractNode<ScriptView> = NodeWrapping::from_hubbub_node(script); + do scriptnode.with_imm_element |script| { + match script.get_attr("src") { + Some(src) => { + debug!("found script: %s", src); + let new_url = make_url(src.to_str(), Some(url3.clone())); + js_chan2.send(JSTaskNewFile(new_url)); + } + None => { + let mut data = ~[]; + debug!("iterating over children %?", scriptnode.first_child()); + for child in scriptnode.children() { + debug!("child = %?", child); + do child.with_imm_text() |text| { + data.push(text.element.data.to_str()); // FIXME: Bad copy. } - - debug!("script data = %?", data); - js_chan.send(JSTaskNewInlineScript(data.concat(), url.clone())); } + + debug!("script data = %?", data); + js_chan2.send(JSTaskNewInlineScript(data.concat(), url3.clone())); } } } } - complete_script(script, url3.clone(), js_chan2.clone()); debug!("complete script"); }, complete_style: |style| { |