From ea52aff6dc5e0630d2cf0681186b59ffe8eb533d Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 9 Nov 2021 00:50:15 +0100 Subject: [PATCH] Rename the ExtendNomError trait to NomErrorExt Co-authored-by: marin --- filter_parser/src/error.rs | 4 ++-- filter_parser/src/lib.rs | 2 +- filter_parser/src/value.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/filter_parser/src/error.rs b/filter_parser/src/error.rs index d52b17200..b162fb554 100644 --- a/filter_parser/src/error.rs +++ b/filter_parser/src/error.rs @@ -5,13 +5,13 @@ use nom::Parser; use crate::{IResult, Span}; -pub trait ExtendNomError { +pub trait NomErrorExt { fn is_failure(&self) -> bool; fn map_err E>(self, op: O) -> nom::Err; fn map_fail E>(self, op: O) -> nom::Err; } -impl ExtendNomError for nom::Err { +impl NomErrorExt for nom::Err { fn is_failure(&self) -> bool { matches!(self, Self::Failure(_)) } diff --git a/filter_parser/src/lib.rs b/filter_parser/src/lib.rs index 7db80888b..c4091fa86 100644 --- a/filter_parser/src/lib.rs +++ b/filter_parser/src/lib.rs @@ -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; diff --git a/filter_parser/src/value.rs b/filter_parser/src/value.rs index d82eda008..6f7952ebd 100644 --- a/filter_parser/src/value.rs +++ b/filter_parser/src/value.rs @@ -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*