term/editor: Use `cfg`-attribute instead of macro
This might result in smaller binaries and is just as readable.
This commit is contained in:
parent
8fb2d96b5c
commit
450b664ad8
|
|
@ -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
|
// On macOS, `nano` is installed by default and it's what most users are used to
|
||||||
// in the terminal.
|
// in the terminal.
|
||||||
if cfg!(target_os = "macos") && exists("nano") {
|
#[cfg(target_os = "macos")]
|
||||||
|
if exists("nano") {
|
||||||
return Some("nano".into());
|
return Some("nano".into());
|
||||||
}
|
}
|
||||||
// If all else fails, we try `vi`. It's usually installed on most unix-based systems.
|
// If all else fails, we try `vi`. It's usually installed on most unix-based systems.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue