mirror of https://github.com/helix-editor/helix
refactor: use `match` instead of `if let`
Co-authored-by: Alexander Brevig <alexander.brevig@hey.com>pull/13847/head
parent
eb486a915f
commit
2a8542e541
|
@ -76,13 +76,10 @@ impl Args {
|
||||||
Some(path) => args.log_file = Some(path.into()),
|
Some(path) => args.log_file = Some(path.into()),
|
||||||
None => anyhow::bail!("--log must specify a path to write"),
|
None => anyhow::bail!("--log must specify a path to write"),
|
||||||
},
|
},
|
||||||
"-e" | "--execute" => {
|
"-e" | "--execute" => match argv.next().as_deref() {
|
||||||
if let Some(command) = argv.next().as_deref() {
|
Some(command) => args.execute = helix_view::input::parse_macro(command)?,
|
||||||
args.execute = helix_view::input::parse_macro(command)?;
|
None => anyhow::bail!("--execute receives a command to execute"),
|
||||||
} else {
|
},
|
||||||
anyhow::bail!("--execute receives a command to execute")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"-w" | "--working-dir" => match argv.next().as_deref() {
|
"-w" | "--working-dir" => match argv.next().as_deref() {
|
||||||
Some(path) => {
|
Some(path) => {
|
||||||
args.working_directory = if Path::new(path).is_dir() {
|
args.working_directory = if Path::new(path).is_dir() {
|
||||||
|
|
Loading…
Reference in New Issue