From b7927436269cd18442c68086e0ce3699194852ca Mon Sep 17 00:00:00 2001 From: Breadway Date: Thu, 6 Aug 2026 08:48:32 +0800 Subject: [PATCH] daemon: use matches! for the link-local host-replace check Silences clippy::match_like_matches_macro; same logic, no behavior change. --- breadcastd/src/daemon.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/breadcastd/src/daemon.rs b/breadcastd/src/daemon.rs index b13f805..95a0d30 100644 --- a/breadcastd/src/daemon.rs +++ b/breadcastd/src/daemon.rs @@ -141,10 +141,10 @@ impl Daemon { // `TcpStream::connect`ing to it fails outright; don't let // one clobber an already-usable host just because it // happened to resolve more recently. - let should_replace = match self.cast_devices.get(&device.id) { - Some(existing) if is_link_local_v6(&device.host) && !is_link_local_v6(&existing.host) => false, - _ => true, - }; + let should_replace = !matches!( + self.cast_devices.get(&device.id), + Some(existing) if is_link_local_v6(&device.host) && !is_link_local_v6(&existing.host) + ); if should_replace { self.cast_devices.insert(device.id.clone(), device); }