Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emoon committed Jan 25, 2025
1 parent dd050e9 commit aa5b7d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/key_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl KeyHandler {
for (idx, is_down) in self.keys.iter().enumerate() {
if *is_down {
unsafe {
keys.push(std::mem::transmute(idx as u8));
keys.push(std::mem::transmute::<u8, Key>(idx as u8));
}
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@ impl KeyHandler {
for (idx, is_down) in self.keys.iter().enumerate() {
if *is_down && self.is_key_index_pressed(idx, repeat) {
unsafe {
keys.push(std::mem::transmute(idx as u8));
keys.push(std::mem::transmute::<u8, Key>(idx as u8));
}
}
}
Expand All @@ -99,7 +99,7 @@ impl KeyHandler {
for (idx, is_down) in self.keys.iter().enumerate() {
if !(*is_down) && self.is_key_index_released(idx) {
unsafe {
keys.push(std::mem::transmute(idx as u8));
keys.push(std::mem::transmute::<u8, Key>(idx as u8));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/os/posix/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl DisplayInfo {

// Give the buffer to the surface and commit
surface.attach(Some(buffer), 0, 0);
surface.damage(0, 0, i32::max_value(), i32::max_value());
surface.damage(0, 0, i32::MAX, i32::MAX);
surface.commit();

let xdg_config = Rc::new(RefCell::new(None));
Expand Down Expand Up @@ -350,7 +350,7 @@ impl DisplayInfo {
let slice = unsafe {
std::slice::from_raw_parts(
buffer.as_ptr() as *const u8,
buffer.len() * std::mem::size_of::<u32>(),
std::mem::size_of_val(buffer),
)
};

Expand All @@ -364,7 +364,7 @@ impl DisplayInfo {

self.surface.attach(Some(buf), 0, 0);
self.surface
.damage(0, 0, i32::max_value(), i32::max_value());
.damage(0, 0, i32::MAX, i32::MAX);
self.surface.commit();

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/os/posix/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ impl Window {
}

fn update_key_state(&mut self, sym: xlib::KeySym, is_down: bool) {
if sym > u32::max_value() as xlib::KeySym {
if sym > u32::MAX as xlib::KeySym {
return;
}

Expand Down

0 comments on commit aa5b7d3

Please sign in to comment.