fix clippy

This commit is contained in:
Martin Marmsoler
2026-07-13 09:32:50 +02:00
committed by Olivier Goffart
parent ca573df559
commit 066c091b56
2 changed files with 4 additions and 6 deletions

View File

@@ -22,11 +22,9 @@ pub struct XkbComposeTable {
impl XkbComposeTable { impl XkbComposeTable {
pub fn new(context: &XkbContext) -> Option<Self> { pub fn new(context: &XkbContext) -> Option<Self> {
let locale = env::var_os("LC_ALL") let locale = env::var_os("LC_ALL")
.and_then(|v| if v.is_empty() { None } else { Some(v) }) .filter(|v| !v.is_empty())
.or_else(|| env::var_os("LC_CTYPE")) .or_else(|| env::var_os("LC_CTYPE").filter(|v| !v.is_empty()))
.and_then(|v| if v.is_empty() { None } else { Some(v) }) .or_else(|| env::var_os("LANG").filter(|v| !v.is_empty()))
.or_else(|| env::var_os("LANG"))
.and_then(|v| if v.is_empty() { None } else { Some(v) })
.unwrap_or_else(|| "C".into()); .unwrap_or_else(|| "C".into());
let locale = CString::new(locale.into_vec()).unwrap(); let locale = CString::new(locale.into_vec()).unwrap();

View File

@@ -59,7 +59,7 @@ fn main() -> Result<(), impl std::error::Error> {
self.windows.clear(); self.windows.clear();
event_loop.exit(); event_loop.exit();
}, },
WindowEvent::PointerEntered { device_id: _, .. } => { WindowEvent::PointerEntered { .. } => {
// On x11, log when the cursor entered in a window even if the child window // On x11, log when the cursor entered in a window even if the child window
// is created by some key inputs. // is created by some key inputs.
// the child windows are always placed at (0, 0) with size (200, 200) in the // the child windows are always placed at (0, 0) with size (200, 200) in the