From: Alexander McLin Date: Sun, 12 Apr 2026 12:42:15 +0000 (-0400) Subject: Issue 3264: refactor `supported_terminal` X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=257209df75d759c19d0b9d61c7f6ffb05381b5c4;p=scryer-prolog.git Issue 3264: refactor `supported_terminal` Use better code style --- diff --git a/src/read/user_interaction.rs b/src/read/user_interaction.rs index 1f5e106d..e6eab103 100644 --- a/src/read/user_interaction.rs +++ b/src/read/user_interaction.rs @@ -38,12 +38,6 @@ pub(crate) fn get_key() -> KeyEvent { } fn supported_terminal() -> bool { - #[cfg(windows)] - let windows_os = true; - - #[cfg(not(windows))] - let windows_os = false; - // If OS is Windows and stdin is not a tty, it's either a pipe or an unsupported terminal configuration. - !windows_os || std::io::stdin().is_tty() + cfg!(not(windows)) || std::io::stdin().is_tty() }