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

@ -237,7 +237,7 @@ pub trait AttrHelpersForLayout<'dom> {
fn value(self) -> &'dom AttrValue;
fn as_str(self) -> &'dom str;
fn as_tokens(self) -> Option<&'dom [Atom]>;
fn local_name(self) -> LocalName;
fn local_name(self) -> &'dom LocalName;
}
#[allow(unsafe_code)]
@ -262,7 +262,7 @@ impl<'dom> AttrHelpersForLayout<'dom> for LayoutDom<'dom, Attr> {
}
#[inline]
fn local_name(self) -> LocalName {
unsafe { self.unsafe_get().identifier.local_name.clone() }
fn local_name(self) -> &'dom LocalName {
unsafe { &self.unsafe_get().identifier.local_name }
}
}