From 35f8d6462c07decd32255c80c7d65c4dd6dd782d Mon Sep 17 00:00:00 2001 From: Costin Lupu Date: Tue, 9 Jan 2024 09:14:23 +0100 Subject: [PATCH] Fix a Clippy warning reported for Rust 1.60 but not for 1.75 Signed-off-by: Costin Lupu --- src/common/commands_parser.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/commands_parser.rs b/src/common/commands_parser.rs index 0da9a7a1b..fde3c4f6f 100644 --- a/src/common/commands_parser.rs +++ b/src/common/commands_parser.rs @@ -583,10 +583,12 @@ mod tests { /// Parse the path of the JSON config file fn parse_config_file(args: &ArgMatches) -> NitroCliResult { - let config_file = args.value_of("config").ok_or(new_nitro_cli_failure!( - "`config` argument not found", - NitroCliErrorEnum::MissingArgument - ))?; + let config_file = args.value_of("config").ok_or_else(|| { + new_nitro_cli_failure!( + "`config` argument not found", + NitroCliErrorEnum::MissingArgument + ) + })?; Ok(config_file.to_string()) }