This commit is contained in:
sxyazi 2023-10-01 13:40:18 +08:00
parent 2965a23dbf
commit 6d10d286aa
No known key found for this signature in database

View file

@ -7,7 +7,7 @@ use shared::Url;
use crate::files::Files; use crate::files::Files;
pub struct Finder { pub struct Finder {
query: Regex, query: Regex,
matched: BTreeMap<Url, u8>, matched: BTreeMap<Url, u8>,
version: u64, version: u64,
} }
@ -124,14 +124,10 @@ impl Finder {
impl Finder { impl Finder {
#[inline] #[inline]
pub fn matched(&self) -> &BTreeMap<Url, u8> { pub fn matched(&self) -> &BTreeMap<Url, u8> { &self.matched }
&self.matched
}
#[inline] #[inline]
pub fn has_matched(&self) -> bool { pub fn has_matched(&self) -> bool { !self.matched.is_empty() }
!self.matched.is_empty()
}
#[inline] #[inline]
pub fn matched_idx(&self, url: &Url) -> Option<u8> { pub fn matched_idx(&self, url: &Url) -> Option<u8> {