Remove an unneeded helper function

This commit is contained in:
Keegan McAllister 2013-09-23 11:40:12 -07:00
parent 69473b6c9c
commit 9bd0e2a3ac

View file

@ -500,37 +500,31 @@ pub fn parse_html(cx: *JSContext,
debug!("encoding change"); debug!("encoding change");
}, },
complete_script: |script| { complete_script: |script| {
// A little function for holding this lint attr unsafe {
fn complete_script(script: hubbub::NodeDataPtr, let scriptnode: AbstractNode<ScriptView> = NodeWrapping::from_hubbub_node(script);
url: Url, do scriptnode.with_imm_element |script| {
js_chan: SharedChan<JSMessage>) { match script.get_attr("src") {
unsafe { Some(src) => {
let scriptnode: AbstractNode<ScriptView> = NodeWrapping::from_hubbub_node(script); debug!("found script: %s", src);
do scriptnode.with_imm_element |script| { let new_url = make_url(src.to_str(), Some(url3.clone()));
match script.get_attr("src") { js_chan2.send(JSTaskNewFile(new_url));
Some(src) => { }
debug!("found script: %s", src); None => {
let new_url = make_url(src.to_str(), Some(url.clone())); let mut data = ~[];
js_chan.send(JSTaskNewFile(new_url)); debug!("iterating over children %?", scriptnode.first_child());
} for child in scriptnode.children() {
None => { debug!("child = %?", child);
let mut data = ~[]; do child.with_imm_text() |text| {
debug!("iterating over children %?", scriptnode.first_child()); data.push(text.element.data.to_str()); // FIXME: Bad copy.
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"); debug!("complete script");
}, },
complete_style: |style| { complete_style: |style| {