style: Do not use borrowed types in the selectors::Element trait.

Closes #22972
Closes #23463
This commit is contained in:
Evgeniy Reizner 2019-05-26 19:10:24 +03:00 committed by Emilio Cobos Álvarez
parent 2e5078e9c5
commit 6f1df517e0
8 changed files with 100 additions and 42 deletions

View file

@ -312,13 +312,24 @@ where
}
#[inline]
fn local_name(&self) -> &<Self::Impl as ::selectors::SelectorImpl>::BorrowedLocalName {
self.element.local_name()
fn has_local_name(
&self,
local_name: &<Self::Impl as ::selectors::SelectorImpl>::BorrowedLocalName,
) -> bool {
self.element.has_local_name(local_name)
}
#[inline]
fn namespace(&self) -> &<Self::Impl as ::selectors::SelectorImpl>::BorrowedNamespaceUrl {
self.element.namespace()
fn has_namespace(
&self,
ns: &<Self::Impl as ::selectors::SelectorImpl>::BorrowedNamespaceUrl,
) -> bool {
self.element.has_namespace(ns)
}
#[inline]
fn is_same_type(&self, other: &Self) -> bool {
self.element.is_same_type(&other.element)
}
fn attr_matches(