Filter check on edit page
This commit is contained in:
+4
-2
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user