Skip to content

Commit 4d8d633

Browse files
committed
Port to nom 6
1 parent 8416074 commit 4d8d633

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ini = ["rust-ini"]
2424
[dependencies]
2525
lazy_static = "1.0"
2626
serde = "1.0.8"
27-
nom = "5.0.0"
27+
nom = "6"
2828

2929
toml = { version = "0.5", optional = true }
3030
serde_json = { version = "1.0.2", optional = true }

src/path/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn ident(i: &str) -> IResult<&str, Expression> {
3535
map(raw_ident, Expression::Identifier)(i)
3636
}
3737

38-
fn postfix<'a>(expr: Expression) -> impl Fn(&'a str) -> IResult<&'a str, Expression> {
38+
fn postfix<'a>(expr: Expression) -> impl FnMut(&'a str) -> IResult<&'a str, Expression> {
3939
let e2 = expr.clone();
4040
let child = map(preceded(tag("."), raw_ident), move |id| {
4141
Expression::Child(Box::new(expr.clone()), id)
@@ -73,10 +73,10 @@ pub fn from_str(input: &str) -> Result<Expression, ErrorKind> {
7373
}
7474
}
7575

76-
pub fn to_error_kind(e: Err<(&str, ErrorKind)>) -> ErrorKind {
76+
pub fn to_error_kind(e: Err<nom::error::Error<&str>>) -> ErrorKind {
7777
match e {
7878
Err::Incomplete(_) => ErrorKind::Complete,
79-
Err::Failure((_, e)) | Err::Error((_, e)) => e,
79+
Err::Failure(e) | Err::Error(e) => e.code,
8080
}
8181
}
8282

0 commit comments

Comments
 (0)