From c286656366a0157663e2f2d0d4b998280bde7a57 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Fri, 3 Jan 2025 20:37:42 -0800 Subject: [PATCH] Fix more clap deprecation issues --- src/options.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/options.rs b/src/options.rs index 8026df4759..43e8272e77 100644 --- a/src/options.rs +++ b/src/options.rs @@ -734,7 +734,10 @@ pub(crate) fn parse_args() -> Mode { _ => unreachable!("clap has already validated the values"), }; - let syntax_highlight = matches.value_of("syntax-highlight") == Some("on"); + let syntax_highlight = matches + .get_one::("syntax-highlight") + .map(|s| s.as_str()) + == Some("on"); let sort_paths = matches.get_flag("sort-paths"); @@ -772,7 +775,7 @@ pub(crate) fn parse_args() -> Mode { let set_exit_code = matches.get_flag("exit-code"); - let strip_cr = matches.value_of("strip-cr") == Some("on"); + let strip_cr = matches.get_one::("strip-cr").map(|s| s.as_str()) == Some("on"); let check_only = matches.get_flag("check-only");