diff --git a/codex-rs/shell-command/src/powershell.rs b/codex-rs/shell-command/src/powershell.rs index c9ee0cfda2..30cb69526a 100644 --- a/codex-rs/shell-command/src/powershell.rs +++ b/codex-rs/shell-command/src/powershell.rs @@ -182,11 +182,7 @@ fn quote_argument(arg: &str) -> String { #[cfg(windows)] #[allow(dead_code)] pub(crate) fn try_find_powershellish_executable_blocking() -> Option { - if let Some(pwsh_path) = try_find_pwsh_executable_blocking() { - Some(pwsh_path) - } else { - try_find_powershell_executable_blocking() - } + try_find_pwsh_executable_blocking().or_else(try_find_powershell_executable_blocking) } /// This function attempts to find a powershell.exe executable on the system.