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