mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
WIP
This commit is contained in:
parent
ad0a4c9181
commit
3e3809a87c
1 changed files with 1 additions and 10 deletions
|
@ -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!(),
|
||||
|
|
Loading…
Add table
Reference in a new issue