mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
re-implement the equality between tokens to only compare the inner value
This commit is contained in:
parent
b249989bef
commit
075d9c97c0
1 changed files with 7 additions and 1 deletions
|
@ -60,12 +60,18 @@ pub type Span<'a> = LocatedSpan<&'a str, &'a str>;
|
|||
|
||||
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 position: Span<'a>,
|
||||
pub inner: &'a str,
|
||||
}
|
||||
|
||||
impl<'a> PartialEq for Token<'a> {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.inner == other.inner
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Token<'a> {
|
||||
pub fn new(position: Span<'a>) -> Self {
|
||||
Self { position, inner: &position }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue