refactor: use `match` instead of `if let`

Co-authored-by: Alexander Brevig <alexander.brevig@hey.com>
pull/13847/head
Nik Revenco 2025-07-10 12:57:00 +01:00 committed by GitHub
parent eb486a915f
commit 2a8542e541
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 7 deletions

View File

@ -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() {