mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
Rename the ExtendNomError trait to NomErrorExt
Co-authored-by: marin <postma.marin@protonmail.com>
This commit is contained in:
parent
ef0d5a8240
commit
ea52aff6dc
@ -5,13 +5,13 @@ use nom::Parser;
|
|||||||
|
|
||||||
use crate::{IResult, Span};
|
use crate::{IResult, Span};
|
||||||
|
|
||||||
pub trait ExtendNomError<E> {
|
pub trait NomErrorExt<E> {
|
||||||
fn is_failure(&self) -> bool;
|
fn is_failure(&self) -> bool;
|
||||||
fn map_err<O: FnOnce(E) -> E>(self, op: O) -> nom::Err<E>;
|
fn map_err<O: FnOnce(E) -> E>(self, op: O) -> nom::Err<E>;
|
||||||
fn map_fail<O: FnOnce(E) -> E>(self, op: O) -> nom::Err<E>;
|
fn map_fail<O: FnOnce(E) -> E>(self, op: O) -> nom::Err<E>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E> ExtendNomError<E> for nom::Err<E> {
|
impl<E> NomErrorExt<E> for nom::Err<E> {
|
||||||
fn is_failure(&self) -> bool {
|
fn is_failure(&self) -> bool {
|
||||||
matches!(self, Self::Failure(_))
|
matches!(self, Self::Failure(_))
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ use std::fmt::Debug;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
pub use condition::{parse_condition, parse_to, Condition};
|
pub use condition::{parse_condition, parse_to, Condition};
|
||||||
use error::{cut_with_err, ExtendNomError};
|
use error::{cut_with_err, NomErrorExt};
|
||||||
pub use error::{Error, ErrorKind};
|
pub use error::{Error, ErrorKind};
|
||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::bytes::complete::tag;
|
use nom::bytes::complete::tag;
|
||||||
|
@ -4,7 +4,7 @@ use nom::character::complete::{char, multispace0};
|
|||||||
use nom::combinator::cut;
|
use nom::combinator::cut;
|
||||||
use nom::sequence::{delimited, terminated};
|
use nom::sequence::{delimited, terminated};
|
||||||
|
|
||||||
use crate::error::ExtendNomError;
|
use crate::error::NomErrorExt;
|
||||||
use crate::{parse_geo_point, parse_geo_radius, Error, ErrorKind, IResult, Span, Token};
|
use crate::{parse_geo_point, parse_geo_radius, Error, ErrorKind, IResult, Span, Token};
|
||||||
|
|
||||||
/// value = WS* ~ ( word | singleQuoted | doubleQuoted) ~ WS*
|
/// value = WS* ~ ( word | singleQuoted | doubleQuoted) ~ WS*
|
||||||
|
Loading…
Reference in New Issue
Block a user