summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoffroy Couprie <geo.couprie@gmail.com>2018-02-17 19:51:50 +0100
committerGeoffroy Couprie <geo.couprie@gmail.com>2018-02-17 19:51:50 +0100
commite3f25ce0d911aa4a2bc3c4ca32d6ed29c98a4a3d (patch)
treef062b25c034a36c6bd864283c2a0b5c88814813d
parent1e16a3bfb7adab7f5e642759e94fb17cba1ea0bd (diff)
update to nom 4
-rw-r--r--Cargo.toml2
-rw-r--r--src/path/parser.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 8ee4d4c..72fd151 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,7 @@ hjson = ["serde-hjson"]
[dependencies]
lazy_static = "1.0"
serde = "^1.0.8"
-nom = "^3.2.1"
+nom = "4.0.0-beta1"
toml = { version = "^0.4.1", optional = true }
serde_json = { version = "^1.0.2", optional = true }
diff --git a/src/path/parser.rs b/src/path/parser.rs
index 7629193..61fa217 100644
--- a/src/path/parser.rs
+++ b/src/path/parser.rs
@@ -55,17 +55,17 @@ fn postfix(expr: Expression) -> Box<Fn(&[u8]) -> IResult<&[u8], Expression>> {
pub fn from_str(input: &str) -> Result<Expression, ErrorKind> {
match ident(input.as_bytes()) {
- IResult::Done(mut rem, mut expr) => {
+ Ok((mut rem, mut expr)) => {
while !rem.is_empty() {
match postfix(expr)(rem) {
- IResult::Done(rem_, expr_) => {
+ Ok((rem_, expr_)) => {
rem = rem_;
expr = expr_;
}
// Forward Incomplete and Error
result => {
- return result.to_result().map_err(|e| e.into_error_kind());
+ return result.map(|(_,o)| o).map_err(|e| e.into_error_kind());
}
}
}
@@ -74,7 +74,7 @@ pub fn from_str(input: &str) -> Result<Expression, ErrorKind> {
}
// Forward Incomplete and Error
- result => result.to_result().map_err(|e| e.into_error_kind()),
+ result => result.map(|(_,o)| o).map_err(|e| e.into_error_kind()),
}
}