From a4c61a421f0e0a8a639badbc45a868498385872f Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 11 Jun 2020 13:11:09 -0500 Subject: [PATCH] Refactor to `cfg!` where possible. --- src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8a64578..d9d4971 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,9 +82,11 @@ impl TTS { builder .add_property("can_detect_screen_reader") .with_getter(|_: &TTS, _| { - #[cfg(windows)] - return true; - return false; + if cfg!(windows) { + true + } else { + false + } }) .done(); builder @@ -95,7 +97,7 @@ impl TTS { let tolk = tolk::Tolk::new(); return tolk.detect_screen_reader().is_some(); } - return false; + false }) .done(); builder