1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pub trait DeduplicatedSelectorsExt
{
#[inline(always)]
fn remove_unmatched_selectors<HtmlDocumentOrNode: Selectable>(&mut self, html_document_and_nodes: &[&HtmlDocumentOrNode]);
}
impl DeduplicatedSelectorsExt for DeduplicatedSelectors
{
#[inline(always)]
fn remove_unmatched_selectors<HtmlDocumentOrNode: Selectable>(&mut self, html_document_and_nodes: &[&HtmlDocumentOrNode])
{
#[inline(always)]
fn retain<HtmlDocumentOrNode: Selectable>(selector: &OurSelector, html_document_and_nodes: &[&HtmlDocumentOrNode]) -> bool
{
const HAS_MATCHES_SO_RETAIN: bool = true;
for selectable in html_document_and_nodes.iter()
{
let has_matches = selectable.find_all_matching_child_nodes_depth_first_including_this_one(selector, &mut |_| HAS_MATCHES_SO_RETAIN);
if has_matches
{
return HAS_MATCHES_SO_RETAIN;
}
}
false
}
self.0.retain(|selector| retain(selector, html_document_and_nodes));
}
}