Skip to content

Commit

Permalink
Fix some Linux Clippy issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
xStrom committed Feb 23, 2024
1 parent 2436d53 commit 014faf9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions druid-shell/src/backend/shared/xkb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ impl State {
}
// add 1 because we will get a null-terminated string.
let len = usize::try_from(len).unwrap() + 1;
let mut buf: Vec<u8> = Vec::new();
buf.resize(len, 0);
let mut buf: Vec<u8> = vec![0; len];
xkb_state_key_get_utf8(self.state, scancode, buf.as_mut_ptr() as *mut c_char, len);
assert!(buf[buf.len() - 1] == 0);
buf.pop();
Expand Down
2 changes: 1 addition & 1 deletion druid-shell/src/backend/wayland/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl Data {

fn current_window_id(&self) -> u64 {
static DEFAULT: u64 = 0_u64;
*self.active_surface_id.borrow().get(0).unwrap_or(&DEFAULT)
*self.active_surface_id.borrow().front().unwrap_or(&DEFAULT)
}

pub(super) fn acquire_current_window(&self) -> Option<WindowHandle> {
Expand Down
3 changes: 3 additions & 0 deletions druid-shell/src/backend/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

//! wayland platform support

// TODO: Remove this and fix the non-Send/Sync Arc issues
#![allow(clippy::arc_with_non_send_sync)]

pub mod application;
pub mod clipboard;
mod display;
Expand Down

0 comments on commit 014faf9

Please sign in to comment.