]> Repositorios git - scryer-prolog.git/commitdiff
Issue 3264: refactor `supported_terminal`
authorAlexander McLin <[email protected]>
Sun, 12 Apr 2026 12:42:15 +0000 (08:42 -0400)
committerAlexander McLin <[email protected]>
Mon, 25 May 2026 22:13:02 +0000 (18:13 -0400)
Use better code style

src/read/user_interaction.rs

index 1f5e106d73a920bca56b363f6c13118a0ff7b185..e6eab1033f9c814342734167a3c746c470eca887 100644 (file)
@@ -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()
 }