Skip to content

Commit 13dd753

Browse files
committed
Revert nom update as it just breaks the REPL
1 parent 957ca8e commit 13dd753

File tree

3 files changed

+19
-74
lines changed

3 files changed

+19
-74
lines changed

Cargo.lock

Lines changed: 14 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66

77
[dependencies]
88
clap = "2.34" # version 3/4 require changes
9-
nom = "6.2" # nom 7.0+ remove the macro compatibility layer
9+
nom = "3.0" # newer versions break the interfaces; 7.0+ removes the macro compatibility layer
1010
rpassword = "7.0"
1111
serde = "1.0"
1212
serde_json = "1.0"

src/repl.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ impl FromStr for CmdArgs {
3838

3939
fn from_str(s: &str) -> Result<CmdArgs, ()> {
4040
arg_list(s.as_ref())
41-
.map(|v| CmdArgs(v.1))
41+
.to_result()
42+
.map(|v| CmdArgs(v))
4243
.map_err(|_| ())
4344
}
4445
}
@@ -112,11 +113,11 @@ named!(consecutive_string <String>,
112113

113114
named!(one_arg <String>, alt!(dq_string | sq_string | consecutive_string));
114115

115-
named!(arg_list<Vec<String>>, separated_list0!(is_a!(" \t"), one_arg));
116+
named!(arg_list<Vec<String>>, separated_list!(is_a!(" \t"), one_arg));
116117

117118
#[cfg(test)]
118119
fn test_parse(s: &str) -> Result<Vec<String>, ::nom::Err<&[u8]>> {
119-
arg_list(s.as_ref()).to_result()
120+
arg_list(s.as_ref())
120121
}
121122

122123
#[test]

0 commit comments

Comments
 (0)