diff --git a/cli/tests/shell_completions_integration.rs b/cli/tests/shell_completions_integration.rs index 47581270..bd4e432a 100644 --- a/cli/tests/shell_completions_integration.rs +++ b/cli/tests/shell_completions_integration.rs @@ -1012,14 +1012,12 @@ cmd other help="Another subcommand" let lines: Vec<&str> = output.lines().collect(); assert!( - lines.iter().any(|l| *l == "sub\tA subcommand\tsub"), + lines.contains(&"sub\tA subcommand\tsub"), "Expected 'sub\\tA subcommand\\tsub' in zsh output, got: {:?}", lines ); assert!( - lines - .iter() - .any(|l| *l == "other\tAnother subcommand\tother"), + lines.contains(&"other\tAnother subcommand\tother"), "Expected 'other\\tAnother subcommand\\tother' in zsh output, got: {:?}", lines ); diff --git a/lib/benches/parse.rs b/lib/benches/parse.rs index 29c8a021..b919ef9c 100644 --- a/lib/benches/parse.rs +++ b/lib/benches/parse.rs @@ -1,4 +1,5 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use criterion::{criterion_group, criterion_main, Criterion}; +use std::hint::black_box; use usage::{parse, Spec, SpecArg, SpecCommand, SpecFlag}; fn build_small_spec() -> Spec { diff --git a/lib/src/parse.rs b/lib/src/parse.rs index 84c96c14..84df8960 100644 --- a/lib/src/parse.rs +++ b/lib/src/parse.rs @@ -2048,11 +2048,11 @@ mod tests { // (d) Negative case: a purely-local flag that shares nothing with a global is NOT // promoted/merged — it is correctly dropped when descending into the mount. assert!( - parsed.available_flags.get("-f").is_none(), + !parsed.available_flags.contains_key("-f"), "purely-local -f must not be promoted onto a global", ); assert!( - parsed.available_flags.get("--force").is_none(), + !parsed.available_flags.contains_key("--force"), "purely-local --force must not be promoted onto a global", );