diff --git a/rslib/src/search/parser.rs b/rslib/src/search/parser.rs index a491a4694..e547f319b 100644 --- a/rslib/src/search/parser.rs +++ b/rslib/src/search/parser.rs @@ -461,7 +461,10 @@ fn parse_prop(s: &str) -> ParseResult { )); }; - Ok(SearchNode::Property { operator, kind }) + Ok(SearchNode::Property { + operator: operator.to_string(), + kind, + }) } /// eg added:1 diff --git a/rslib/src/search/sqlwriter.rs b/rslib/src/search/sqlwriter.rs index 7a359333a..e64b7f6df 100644 --- a/rslib/src/search/sqlwriter.rs +++ b/rslib/src/search/sqlwriter.rs @@ -226,8 +226,19 @@ impl SqlWriter<'_> { ">=" => write!(self.sql, " >= {}", day_before_cutoff_ms), "<" => write!(self.sql, " < {}", day_before_cutoff_ms), "<=" => write!(self.sql, " < {}", target_cutoff_ms), - "=" => write!(self.sql, " between {} and {}", day_before_cutoff_ms, target_cutoff_ms - 1), - _ /* "!=" */ => write!(self.sql, " not between {} and {}", day_before_cutoff_ms, target_cutoff_ms - 1), + "=" => write!( + self.sql, + " between {} and {}", + day_before_cutoff_ms, + target_cutoff_ms - 1 + ), + "!=" => write!( + self.sql, + " not between {} and {}", + day_before_cutoff_ms, + target_cutoff_ms - 1 + ), + _ => unreachable!("unexpected op"), } .unwrap();