Rename the ExtendNomError trait to NomErrorExt

Co-authored-by: marin <postma.marin@protonmail.com>
This commit is contained in:
Tamo 2021-11-09 00:50:15 +01:00 committed by Irevoire
parent ef0d5a8240
commit ea52aff6dc
No known key found for this signature in database
GPG Key ID: 7A6A970C96104F1B
3 changed files with 4 additions and 4 deletions

View File

@ -5,13 +5,13 @@ use nom::Parser;
use crate::{IResult, Span};
pub trait ExtendNomError<E> {
pub trait NomErrorExt<E> {
fn is_failure(&self) -> bool;
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>;
}
impl<E> ExtendNomError<E> for nom::Err<E> {
impl<E> NomErrorExt<E> for nom::Err<E> {
fn is_failure(&self) -> bool {
matches!(self, Self::Failure(_))
}

View File

@ -43,7 +43,7 @@ use std::fmt::Debug;
use std::str::FromStr;
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};
use nom::branch::alt;
use nom::bytes::complete::tag;

View File

@ -4,7 +4,7 @@ use nom::character::complete::{char, multispace0};
use nom::combinator::cut;
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};
/// value = WS* ~ ( word | singleQuoted | doubleQuoted) ~ WS*