From 6498a0cf8a5053e8a55fb503800e11b00953ecdc Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Wed, 6 Mar 2024 12:03:33 +0900 Subject: [PATCH] cli: propagate type error of "ui.default-command" --- cli/src/cli_util.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index eca195a12..ae6968ad1 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -2204,8 +2204,8 @@ fn resolve_default_command( if let Some(matches) = matches { if matches.subcommand_name().is_none() { - let args = get_string_or_array(config, "ui.default-command"); - if args.is_err() { + let args = get_string_or_array(config, "ui.default-command").optional()?; + if args.is_none() { writeln!( ui.hint(), "Hint: Use `jj -h` for a list of available commands." @@ -2215,7 +2215,7 @@ fn resolve_default_command( "Run `jj config set --user ui.default-command log` to disable this message." )?; } - let default_command = args.unwrap_or_else(|_| vec!["log".to_string()]); + let default_command = args.unwrap_or_else(|| vec!["log".to_string()]); // Insert the default command directly after the path to the binary. string_args.splice(1..1, default_command);