From 3979e48f89b88f175d6e62f21f1d402ea8218b4d Mon Sep 17 00:00:00 2001 From: Hamza Date: Mon, 19 Oct 2026 22:41:20 +0500 Subject: [PATCH] Desktop theme: the watcher's link has a type off Linux, so the gate passes there `cargo xtask ci` has not passed on macOS or Windows since cc21643: error: this let-binding has unit value --> crates/ui-egui/src/desktop_theme.rs:36:13 36 | let mut link = Link::default(); `Link` is the session-bus connection the watcher keeps between reads. Off Linux there is no bus to keep, so it was aliased to `()`, which makes that binding a unit binding: `clippy::let_unit_value` reports it and the gate's `-D warnings` turns it into an error. CI runs Linux only, where `Link` is a real `Option`, so nothing catches it there. Off Linux `Link` is now a unit struct rather than `()`. The binding has a type, the lint does not apply, and nothing else changes: `read` still ignores it on those platforms. An `allow` on the line would also work, but a named type says what the thing is rather than silencing a lint that only fires on some platforms. --- crates/ui-egui/src/desktop_theme.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/desktop_theme.rs b/crates/ui-egui/src/desktop_theme.rs index 9d67c337a..35d413b1d 100644 --- a/crates/ui-egui/src/desktop_theme.rs +++ b/crates/ui-egui/src/desktop_theme.rs @@ -67,11 +67,16 @@ impl DesktopTheme { } } -/// The session-bus connection the watcher keeps between reads, opened on first use. +/// The session-bus connection the watcher keeps between reads, opened on first use. Off Linux +/// there is no bus to keep, and a unit struct rather than `()` keeps `let mut link = …` from +/// reading as a unit binding, which `cargo xtask ci` refuses on those platforms. #[cfg(target_os = "linux")] type Link = Option; #[cfg(not(target_os = "linux"))] -type Link = (); +#[derive(Default)] +pub(crate) struct NoLink; +#[cfg(not(target_os = "linux"))] +type Link = NoLink; /// Ask the portal once, over `link`'s connection (opened if absent, dropped if the bus went /// away). D-Bus calls block, so this belongs off the UI thread: the watcher's thread is its