mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Remove unnecessary copying in hubbub parser part 2
This commit is contained in:
parent
33c9166877
commit
a81781ad71
1 changed files with 2 additions and 3 deletions
|
@ -274,14 +274,13 @@ pub fn parse_html(url: Url,
|
||||||
},
|
},
|
||||||
create_element: |tag: ~hubbub::Tag| {
|
create_element: |tag: ~hubbub::Tag| {
|
||||||
debug!("create element");
|
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);
|
let node = build_element_from_tag(tag.name);
|
||||||
|
|
||||||
debug!("-- attach attrs");
|
debug!("-- attach attrs");
|
||||||
do node.as_mut_element |element| {
|
do node.as_mut_element |element| {
|
||||||
for tag.attributes.each |attr| {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue