diff --git a/src/filter.rs b/src/filter.rs index 4389f52..a8a74bf 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -42,7 +42,7 @@ pub type CardFilter = Box bool>; pub type RawCardFilter = (Field, Operator, Value); pub fn fallback_filter(query: &str) -> Result { - if query.contains(&OPERATOR_CHARS[..]) { + if query.contains(OPERATOR_CHARS) { return Err(format!("Invalid query: {query}")); } #[cfg(debug_assertions)] diff --git a/src/parser.rs b/src/parser.rs index 727fe86..f30e632 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -30,7 +30,7 @@ fn word_non_empty(input: &str) -> IResult<&str, &str> { } fn parse_raw_filter(input: &str) -> IResult<&str, RawCardFilter> { - preceded(multispace0, alt((complete(tuple((field, operator, value))), map_res(word_non_empty, |q| fallback_filter(q)))))(input) + preceded(multispace0, alt((complete(tuple((field, operator, value))), map_res(word_non_empty, fallback_filter))))(input) } fn field(input: &str) -> IResult<&str, Field> {