Filter check on edit page

This commit is contained in:
2026-08-18 17:45:50 +03:00
parent d3c28179b6
commit 4187344a29
8 changed files with 27 additions and 12 deletions
+4 -2
View File
@@ -26,7 +26,7 @@ const MAX_HISTORY_LEN_PART: f32 = 0.33;
const MAX_SCORE: u8 = 25;
const FADE_PER_DAY: f32 = 0.95;
#[derive(Clone, PartialEq, Eq, Debug, Hash, Copy)]
pub(crate) struct Id(u32);
pub struct Id(u32);
pub const INVALID_ID: Id = Id(0);
impl FromStr for Id {
type Err = ParseIntError;
@@ -650,9 +650,11 @@ impl DeckSettings {
open_mode: OrderMode::Default,
}
}
pub(crate) fn check_filter(&self) -> bool {
pub fn check_filter(&self) -> bool {
let time = Instant::now();
let engine = Engine::new();
let ast = engine.compile(&self.filter);
println!("Compile time is {:?}", time.elapsed());
ast.is_ok()
}
pub fn get_word_list(&self, state: &AppState) -> Vec<usize> {