Skip to content

Commit

Permalink
windows: fix build
Browse files Browse the repository at this point in the history
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 <= <u8 as Into<T>>::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 <= <u8 as Into<T>>::into(u8::MAX) && key.1 <= u8::MAX.into() {
     |                        ++++++++++++++++++++++       ~

```
  • Loading branch information
wez committed Aug 21, 2023
1 parent 89fbb87 commit 0456719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions window/src/os/windows/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down

0 comments on commit 0456719

Please sign in to comment.