From 20ffa8cbb229901b0d2f2fdc134a50c0afa11f87 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Fri, 1 Jul 2022 21:40:05 +0300 Subject: [PATCH 1/3] Satisfy clippy 1.62. --- druid-shell/src/backend/windows/menu.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/druid-shell/src/backend/windows/menu.rs b/druid-shell/src/backend/windows/menu.rs index d4ed0674f5..b3f1c92e09 100644 --- a/druid-shell/src/backend/windows/menu.rs +++ b/druid-shell/src/backend/windows/menu.rs @@ -15,6 +15,7 @@ //! Safe wrapper for menus. use std::collections::HashMap; +use std::fmt::Write as _; use std::mem; use std::ptr::null; @@ -219,6 +220,7 @@ fn format_hotkey(key: &HotKey, s: &mut String) { KbKey::ArrowRight => s.push_str("Right"), KbKey::ArrowUp => s.push_str("Up"), KbKey::ArrowDown => s.push_str("Down"), - _ => s.push_str(&format!("{:?}", key.key)), + _ => write!(s, "{}", key.key) + .unwrap_or_else(|err| tracing::warn!("Failed to convert hotkey to string: {}", err)), } } From 4b33653fd1f494fd51e6933c49b4a5cf24f13e3d Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Fri, 1 Jul 2022 21:50:57 +0300 Subject: [PATCH 2/3] Remove useless unit value binding. --- druid-shell/src/backend/wayland/pointers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/druid-shell/src/backend/wayland/pointers.rs b/druid-shell/src/backend/wayland/pointers.rs index b6d25fc583..bb6701e38b 100644 --- a/druid-shell/src/backend/wayland/pointers.rs +++ b/druid-shell/src/backend/wayland/pointers.rs @@ -333,7 +333,7 @@ impl Pointer { )) } ButtonState::Released => { - let mut updated = self.buttons.borrow_mut().remove(button); + self.buttons.borrow_mut().remove(button); self.clickevent.borrow_mut().debounce(MouseEvtKind::Up( mouse::MouseEvent { pos: self.pos.get(), From 4f6bbfbaeba1345021d216fb66d3528e90a29951 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Fri, 1 Jul 2022 23:46:28 +0300 Subject: [PATCH 3/3] Ignore GTK macro doc code during tests. --- druid-shell/src/backend/gtk/window.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/druid-shell/src/backend/gtk/window.rs b/druid-shell/src/backend/gtk/window.rs index 0d08f782fb..c00bf87b69 100644 --- a/druid-shell/src/backend/gtk/window.rs +++ b/druid-shell/src/backend/gtk/window.rs @@ -76,11 +76,11 @@ const SCALE_TARGET_DPI: f64 = 96.0; /// Taken from /// It is used to reduce the boilerplate of setting up gtk callbacks /// Example: -/// ``` +/// ```ignore /// button.connect_clicked(clone!(handle => move |_| { ... })) /// ``` /// is equivalent to: -/// ``` +/// ```ignore /// { /// let handle = handle.clone(); /// button.connect_clicked(move |_| { ... })