mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
fix escaped quotes in filter
This commit is contained in:
parent
9580b9de79
commit
90afde435b
2 changed files with 78 additions and 14 deletions
|
@ -40,7 +40,6 @@ mod error;
|
|||
mod value;
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::ops::Deref;
|
||||
use std::str::FromStr;
|
||||
|
||||
pub use condition::{parse_condition, parse_to, Condition};
|
||||
|
@ -70,14 +69,6 @@ pub struct Token<'a> {
|
|||
value: Option<String>,
|
||||
}
|
||||
|
||||
impl<'a> Deref for Token<'a> {
|
||||
type Target = &'a str;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.span
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> PartialEq for Token<'a> {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.span.fragment() == other.span.fragment()
|
||||
|
@ -89,6 +80,10 @@ impl<'a> Token<'a> {
|
|||
Self { span, value }
|
||||
}
|
||||
|
||||
pub fn lexeme(&self) -> &str {
|
||||
&self.span
|
||||
}
|
||||
|
||||
pub fn value(&self) -> &str {
|
||||
self.value.as_ref().map_or(&self.span, |value| value)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue