Don't clone the result of AttrHelpersForLayout::local_name

There is no need to do that. Embrace returning borrows from the DOM, it good.
This commit is contained in:
Anthony Ramine 2020-03-31 14:02:14 +02:00
parent 4db84bede8
commit 47c9f19121
2 changed files with 5 additions and 5 deletions

View file

@ -578,7 +578,7 @@ pub unsafe fn get_attr_for_layout<'dom>(
.iter()
.find(|attr| {
let attr = attr.to_layout();
*name == attr.local_name() && (*attr.unsafe_get()).namespace() == namespace
name == attr.local_name() && (*attr.unsafe_get()).namespace() == namespace
})
.map(|attr| attr.to_layout())
}
@ -610,7 +610,7 @@ impl RawLayoutElementHelpers for Element {
.iter()
.filter_map(|attr| {
let attr = attr.to_layout();
if *name == attr.local_name() {
if name == attr.local_name() {
Some(attr.value())
} else {
None