From 0456719980c428d2af897e2066f248043ebe1d0e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 21 Aug 2023 06:00:51 -0700 Subject: [PATCH] windows: fix build Weirdly, the rust compiler is suddenly complaining about this, when this file hasn't changed. ``` error[E0283]: type annotations needed --> window\src\os\windows\window.rs:2398:26 | 2398 | if vk <= u8::MAX.into() { | -- ^^^^ | | | type must be known at this point | = note: cannot satisfy `u32: PartialOrd<_>` help: try using a fully qualified path to specify the expected types | 2398 | if vk <= >::into(u8::MAX) { | ++++++++++++++++++++++ ~ error[E0283]: type annotations needed --> window\src\os\windows\window.rs:2415:32 | 2415 | if leader.1 <= u8::MAX.into() && key.1 <= u8::MAX.into() { | -- ^^^^ | | | type must be known at this point | = note: cannot satisfy `u32: PartialOrd<_>` help: try using a fully qualified path to specify the expected types | 2415 | if leader.1 <= >::into(u8::MAX) && key.1 <= u8::MAX.into() { | ++++++++++++++++++++++ ~ ``` --- window/src/os/windows/window.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/window/src/os/windows/window.rs b/window/src/os/windows/window.rs index 6b6f59a361e..29d7b97e548 100644 --- a/window/src/os/windows/window.rs +++ b/window/src/os/windows/window.rs @@ -2395,7 +2395,7 @@ impl KeyboardLayoutInfo { unsafe { self.update(); } - if vk <= u8::MAX.into() { + if vk <= (u8::MAX as u32) { self.dead_keys .get(&(Self::fixup_mods(mods), vk as u8)) .map(|dead| dead.dead_char) @@ -2412,7 +2412,7 @@ impl KeyboardLayoutInfo { unsafe { self.update(); } - if leader.1 <= u8::MAX.into() && key.1 <= u8::MAX.into() { + if leader.1 <= (u8::MAX as u32) && key.1 <= (u8::MAX as u32) { if let Some(dead) = self .dead_keys .get(&(Self::fixup_mods(leader.0), leader.1 as u8))