summaryrefslogtreecommitdiffstats
path: root/src/path
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2021-05-06 17:49:23 +0200
committerkpcyrd <git@rxv.cc>2021-05-07 18:17:39 +0200
commit4d8d633013b4f87d0790568731d09a3e97cd5163 (patch)
treed2bdb5496811488f19c5ef35d52d25fa2ab5ba3e /src/path
parent84160744ba70b6cedf223d7ed60148e41c2cdafe (diff)
Port to nom 6
Diffstat (limited to 'src/path')
-rw-r--r--src/path/parser.rs6
1 files changed, 3 insertions, 3 deletions
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,
}
}