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 part 2 #414

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 part 2

  • Loading branch information
ILyoan committed May 3, 2013
commit a81781ad71c64c218bf4faa485b60a033f1d2d6f
@@ -274,14 +274,13 @@ pub fn parse_html(url: Url,
},
create_element: |tag: ~hubbub::Tag| {
debug!("create element");
// TODO: remove copying here by using struct pattern matching to
// move all ~strs at once (blocked on Rust #3845, #3846, #3847)
let node = build_element_from_tag(tag.name);

debug!("-- attach attrs");
do node.as_mut_element |element| {
for tag.attributes.each |attr| {
element.attrs.push(Attr::new(copy attr.name, copy attr.value));
let &hubbub::Attribute {name: name, value: value, _} = attr;
element.attrs.push(Attr::new(name, value));
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.