mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
switch to regex 0.2 (#876)
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
This commit is contained in:
parent
389658d945
commit
40052bdc0c
2 changed files with 4 additions and 4 deletions
|
@ -29,7 +29,7 @@ clippy = { version = "~0.0.112", optional = true }
|
||||||
atty = { version = "0.2.2", optional = true }
|
atty = { version = "0.2.2", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
regex = "~0.1.80"
|
regex = "0.2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["suggestions", "color", "wrap_help"]
|
default = ["suggestions", "color", "wrap_help"]
|
||||||
|
|
|
@ -12,8 +12,8 @@ mod test {
|
||||||
S2: AsRef<str> {
|
S2: AsRef<str> {
|
||||||
let re = Regex::new("\x1b[^m]*m").unwrap();
|
let re = Regex::new("\x1b[^m]*m").unwrap();
|
||||||
// Strip out any mismatching \r character on windows that might sneak in on either side
|
// Strip out any mismatching \r character on windows that might sneak in on either side
|
||||||
let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "");
|
let left = re.replace_all(&l.as_ref().trim().replace("\r", "")[..], "").into_owned();
|
||||||
let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "");
|
let right = re.replace_all(&r.as_ref().trim().replace("\r", "")[..], "").into_owned();
|
||||||
let b = left == right;
|
let b = left == right;
|
||||||
if !b {
|
if !b {
|
||||||
println!("");
|
println!("");
|
||||||
|
@ -69,4 +69,4 @@ mod test {
|
||||||
.arg_from_usage("-o --option [scoption]... 'tests options'")
|
.arg_from_usage("-o --option [scoption]... 'tests options'")
|
||||||
.arg_from_usage("[scpositional] 'tests positionals'"))
|
.arg_from_usage("[scpositional] 'tests positionals'"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue