From a70ff9907c6404067be0bc974dbfd2d24c7fb60f Mon Sep 17 00:00:00 2001 From: kageru Date: Mon, 30 Jan 2023 17:40:19 +0100 Subject: [PATCH] allow != for text search --- src/filter.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/filter.rs b/src/filter.rs index 618b8d7..28ea3e7 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -69,7 +69,9 @@ pub fn build_filter(query: RawCardFilter) -> Result { RawCardFilter(Field::Class, Operator::Equal, Value::String(s)) => Box::new(move |card| card.card_type.contains(&s)), RawCardFilter(Field::Class, Operator::NotEqual, Value::String(s)) => Box::new(move |card| !card.card_type.contains(&s)), RawCardFilter(Field::Text, Operator::Equal, Value::String(s)) => Box::new(move |card| card.text.contains(&s)), + RawCardFilter(Field::Text, Operator::NotEqual, Value::String(s)) => Box::new(move |card| !card.text.contains(&s)), RawCardFilter(Field::Name, Operator::Equal, Value::String(s)) => Box::new(move |card| card.name.contains(&s)), + RawCardFilter(Field::Name, Operator::NotEqual, Value::String(s)) => Box::new(move |card| !card.name.contains(&s)), q => Err(format!("unknown query: {q:?}"))?, }) }