From 4d8d633013b4f87d0790568731d09a3e97cd5163 Mon Sep 17 00:00:00 2001 From: kpcyrd Date: Thu, 6 May 2021 17:49:23 +0200 Subject: Port to nom 6 --- Cargo.toml | 2 +- src/path/parser.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index abec5bd..ca28c06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ ini = ["rust-ini"] [dependencies] lazy_static = "1.0" serde = "1.0.8" -nom = "5.0.0" +nom = "6" toml = { version = "0.5", optional = true } serde_json = { version = "1.0.2", optional = true } diff --git a/src/path/parser.rs b/src/path/parser.rs index 3f7bc52..1867657 100644 --- a/src/path/parser.rs +++ b/src/path/parser.rs @@ -35,7 +35,7 @@ fn ident(i: &str) -> IResult<&str, Expression> { map(raw_ident, Expression::Identifier)(i) } -fn postfix<'a>(expr: Expression) -> impl Fn(&'a str) -> IResult<&'a str, Expression> { +fn postfix<'a>(expr: Expression) -> impl FnMut(&'a str) -> IResult<&'a str, Expression> { let e2 = expr.clone(); let child = map(preceded(tag("."), raw_ident), move |id| { Expression::Child(Box::new(expr.clone()), id) @@ -73,10 +73,10 @@ pub fn from_str(input: &str) -> Result { } } -pub fn to_error_kind(e: Err<(&str, ErrorKind)>) -> ErrorKind { +pub fn to_error_kind(e: Err>) -> ErrorKind { match e { Err::Incomplete(_) => ErrorKind::Complete, - Err::Failure((_, e)) | Err::Error((_, e)) => e, + Err::Failure(e) | Err::Error(e) => e.code, } } -- cgit v1.2.3