1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00
This commit is contained in:
Marvin Hagemeister 2025-01-01 12:33:49 +01:00
parent ad0a4c9181
commit 3e3809a87c

View file

@ -295,26 +295,17 @@ impl SelectorMatcher for Elem {
#[derive(Debug, PartialEq)]
struct Selector {
// short circuit if the selecor cannot match
never: bool,
parts: Vec<SelPart>,
}
impl Selector {
fn new() -> Self {
Self {
never: false,
parts: vec![],
}
Self { parts: vec![] }
}
}
impl SelectorMatcher for Selector {
fn matches(&mut self, offset: usize) -> bool {
if self.never {
return false;
}
self.parts.iter().all(|part| match part {
SelPart::Wildcard => todo!(),
SelPart::Elem(_) => todo!(),