mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08: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