mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
re-implement the equality between tokens to only compare the inner value
This commit is contained in:
parent
b249989bef
commit
075d9c97c0
@ -60,12 +60,18 @@ pub type Span<'a> = LocatedSpan<&'a str, &'a str>;
|
|||||||
|
|
||||||
type IResult<'a, Ret> = nom::IResult<Span<'a>, Ret, Error<'a>>;
|
type IResult<'a, Ret> = nom::IResult<Span<'a>, Ret, Error<'a>>;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, Eq)]
|
||||||
pub struct Token<'a> {
|
pub struct Token<'a> {
|
||||||
pub position: Span<'a>,
|
pub position: Span<'a>,
|
||||||
pub inner: &'a str,
|
pub inner: &'a str,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> PartialEq for Token<'a> {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
self.inner == other.inner
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> Token<'a> {
|
impl<'a> Token<'a> {
|
||||||
pub fn new(position: Span<'a>) -> Self {
|
pub fn new(position: Span<'a>) -> Self {
|
||||||
Self { position, inner: &position }
|
Self { position, inner: &position }
|
||||||
|
Loading…
Reference in New Issue
Block a user