Skip to content

Commit

Permalink
simplify redundant std::char paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrgani authored and not-fl3 committed Dec 19, 2024
1 parent c280723 commit b4fa8fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/native/linux_wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ where

let chr = keycodes::keysym_to_unicode(&mut display.xkb, *keysym);
if chr > 0 {
if let Some(chr) = std::char::from_u32(chr as u32) {
if let Some(chr) = char::from_u32(chr as u32) {
event_handler.char_event(chr, keymods, true);
}
}
Expand Down Expand Up @@ -821,7 +821,7 @@ where

let chr = keycodes::keysym_to_unicode(&mut display.xkb, keysym);
if chr > 0 {
if let Some(chr) = std::char::from_u32(chr as u32) {
if let Some(chr) = char::from_u32(chr as u32) {
event_handler.char_event(chr, keymods, false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/native/linux_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl X11Display {
);
let chr = keycodes::keysym_to_unicode(&mut self.libxkbcommon, keysym);
if chr > 0 {
if let Some(chr) = std::char::from_u32(chr as u32) {
if let Some(chr) = char::from_u32(chr as u32) {
event_handler.char_event(chr, mods, repeat);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/native/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ unsafe extern "system" fn win32_wndproc(
let repeat = !!(lparam & 0x40000000) != 0;
let mods = key_mods();
if chr > 0 {
if let Some(chr) = std::char::from_u32(chr as u32) {
if let Some(chr) = char::from_u32(chr as u32) {
event_handler.char_event(chr, mods, repeat);
}
}
Expand Down

0 comments on commit b4fa8fe

Please sign in to comment.