From 97692650728d1ef6bba8bee42592ba694cb0c1d9 Mon Sep 17 00:00:00 2001 From: rszyma Date: Thu, 16 Nov 2023 13:40:16 +0100 Subject: [PATCH] remove reduntant `any` --- parser/src/keys/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/src/keys/mod.rs b/parser/src/keys/mod.rs index ce12f5f3b..e611b8aa1 100644 --- a/parser/src/keys/mod.rs +++ b/parser/src/keys/mod.rs @@ -11,42 +11,42 @@ mod windows; mod mappings; pub use mappings::*; -#[cfg(any(target_os = "unknown"))] +#[cfg(target_os = "unknown")] #[derive(Clone, Copy)] pub enum Platform { Win, Linux, } -#[cfg(any(target_os = "unknown"))] +#[cfg(target_os = "unknown")] pub static OSCODE_MAPPING_VARIANT: Mutex = Mutex::new(Platform::Linux); impl OsCode { pub fn as_u16(self) -> u16 { - #[cfg(any(target_os = "unknown"))] + #[cfg(target_os = "unknown")] return match *OSCODE_MAPPING_VARIANT.lock() { Platform::Win => self.as_u16_windows(), Platform::Linux => self.as_u16_linux(), }; - #[cfg(any(target_os = "linux"))] + #[cfg(target_os = "linux")] return self.as_u16_linux(); - #[cfg(any(target_os = "windows"))] + #[cfg(target_os = "windows")] return self.as_u16_windows(); } pub fn from_u16(code: u16) -> Option { - #[cfg(any(target_os = "unknown"))] + #[cfg(target_os = "unknown")] return match *OSCODE_MAPPING_VARIANT.lock() { Platform::Win => OsCode::from_u16_windows(code), Platform::Linux => OsCode::from_u16_linux(code), }; - #[cfg(any(target_os = "linux"))] + #[cfg(target_os = "linux")] return OsCode::from_u16_linux(code); - #[cfg(any(target_os = "windows"))] + #[cfg(target_os = "windows")] return OsCode::from_u16_windows(code); } }