From 2a8542e541a5d4e55c5a3218b025ac278592ae56 Mon Sep 17 00:00:00 2001 From: Nik Revenco Date: Thu, 10 Jul 2025 12:57:00 +0100 Subject: [PATCH] refactor: use `match` instead of `if let` Co-authored-by: Alexander Brevig --- helix-term/src/args.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index a907d6f33..f3b6b6198 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -76,13 +76,10 @@ impl Args { Some(path) => args.log_file = Some(path.into()), None => anyhow::bail!("--log must specify a path to write"), }, - "-e" | "--execute" => { - if let Some(command) = argv.next().as_deref() { - args.execute = helix_view::input::parse_macro(command)?; - } else { - anyhow::bail!("--execute receives a command to execute") - } - } + "-e" | "--execute" => match argv.next().as_deref() { + Some(command) => args.execute = helix_view::input::parse_macro(command)?, + None => anyhow::bail!("--execute receives a command to execute"), + }, "-w" | "--working-dir" => match argv.next().as_deref() { Some(path) => { args.working_directory = if Path::new(path).is_dir() {