From 21a586913aeb3e8f0e01460536e5b6bfea621de5 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 4 May 2022 15:15:38 -0400 Subject: [PATCH] cleanup `is_mobile` method --- src/consts.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/consts.rs b/src/consts.rs index 7d5677b..e96cba4 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -87,14 +87,9 @@ lazy_static::lazy_static! { }; } -#[cfg(not(target_arch = "wasm32"))] -const IS_MOBILE: bool = false; - #[inline] -pub fn is_mobile() -> bool { - #[cfg(target_arch = "wasm32")] - return *IS_MOBILE; +#[cfg(target_arch = "wasm32")] +pub fn is_mobile() -> bool { return *IS_MOBILE; } - #[cfg(not(target_arch = "wasm32"))] - return IS_MOBILE; -} +#[cfg(not(target_arch = "wasm32"))] +pub const fn is_mobile() -> bool { return false; }