Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary copying in hubbub parser #413

Merged
merged 1 commit into from May 3, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Remove unnecessary copying in hubbub parser

  • Loading branch information
ILyoan committed May 3, 2013
commit 4452d1943b9548bf81b993e68c238cedd945d8e2
@@ -260,20 +260,14 @@ pub fn parse_html(url: Url,
},
create_doctype: |doctype: ~hubbub::Doctype| {
debug!("create doctype");
// TODO: remove copying here by using struct pattern matching to
// move all ~strs at once (blocked on Rust #3845, #3846, #3847)
let public_id = match &doctype.public_id {
&None => None,
&Some(ref id) => Some(copy *id)
};
let system_id = match &doctype.system_id {
&None => None,
&Some(ref id) => Some(copy *id)
};
let node = ~Doctype::new(copy doctype.name,
let ~hubbub::Doctype {name: name,
public_id: public_id,
system_id: system_id,
force_quirks: force_quirks } = doctype;
let node = ~Doctype::new(name,
public_id,
system_id,
doctype.force_quirks);
force_quirks);
unsafe {
Node::as_abstract_node(node).to_hubbub_node()
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.