From 8f5f58028ac367ac4565e9b89c0e7b85da3d2dba Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 11 May 2021 20:18:14 -0500 Subject: [PATCH] Use attributes instead. --- src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 50af8ac..9b742a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -531,8 +531,10 @@ impl Tts { /* * Returns `true` if a screen reader is available to provide speech. */ + #[allow(unreachable_code)] pub fn screen_reader_available() -> bool { - if cfg!(target_os = "windows") { + #[cfg(target_os = "windows")] + { #[cfg(feature = "tolk")] { let tolk = tolk::Tolk::new(); @@ -540,9 +542,8 @@ impl Tts { } #[cfg(not(feature = "tolk"))] return false; - } else { - false } + false } }