term/editor: Use `cfg`-attribute instead of macro

This might result in smaller binaries and is just as readable.
This commit is contained in:
Lorenz Leutgeb 2026-02-10 14:45:57 +01:00
parent 8fb2d96b5c
commit 450b664ad8
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -223,7 +223,8 @@ fn default_editor() -> Option<OsString> {
// On macOS, `nano` is installed by default and it's what most users are used to
// in the terminal.
if cfg!(target_os = "macos") && exists("nano") {
#[cfg(target_os = "macos")]
if exists("nano") {
return Some("nano".into());
}
// If all else fails, we try `vi`. It's usually installed on most unix-based systems.