mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Make the SelectorMap API slightly nicer.
This commit is contained in:
parent
52f962c387
commit
7861ec1d5b
3 changed files with 7 additions and 7 deletions
|
@ -294,7 +294,7 @@ impl<T: SelectorMapEntry> SelectorMap<T> {
|
|||
/// FIXME(bholley) This overlaps with SelectorMap<Rule>::get_all_matching_rules,
|
||||
/// but that function is extremely hot and I'd rather not rearrange it.
|
||||
#[inline]
|
||||
pub fn lookup<'a, E, F>(&'a self, element: E, quirks_mode: QuirksMode, f: &mut F) -> bool
|
||||
pub fn lookup<'a, E, F>(&'a self, element: E, quirks_mode: QuirksMode, mut f: F) -> bool
|
||||
where
|
||||
E: TElement,
|
||||
F: FnMut(&'a T) -> bool
|
||||
|
@ -361,14 +361,14 @@ impl<T: SelectorMapEntry> SelectorMap<T> {
|
|||
quirks_mode: QuirksMode,
|
||||
additional_id: Option<&Atom>,
|
||||
additional_classes: &[Atom],
|
||||
f: &mut F,
|
||||
mut f: F,
|
||||
) -> bool
|
||||
where
|
||||
E: TElement,
|
||||
F: FnMut(&'a T) -> bool
|
||||
{
|
||||
// Do the normal lookup.
|
||||
if !self.lookup(element, quirks_mode, f) {
|
||||
if !self.lookup(element, quirks_mode, |entry| f(entry)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue