diff options
author | kpcyrd <git@rxv.cc> | 2021-05-06 17:49:23 +0200 |
---|---|---|
committer | kpcyrd <git@rxv.cc> | 2021-05-07 18:17:39 +0200 |
commit | 4d8d633013b4f87d0790568731d09a3e97cd5163 (patch) | |
tree | d2bdb5496811488f19c5ef35d52d25fa2ab5ba3e | |
parent | 84160744ba70b6cedf223d7ed60148e41c2cdafe (diff) |
Port to nom 6
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/path/parser.rs | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -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<Expression, ErrorKind> { } } -pub fn to_error_kind(e: Err<(&str, ErrorKind)>) -> ErrorKind { +pub fn to_error_kind(e: Err<nom::error::Error<&str>>) -> ErrorKind { match e { Err::Incomplete(_) => ErrorKind::Complete, - Err::Failure((_, e)) | Err::Error((_, e)) => e, + Err::Failure(e) | Err::Error(e) => e.code, } } |