From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 9C6EB1FF14F for ; Fri, 08 May 2026 17:05:47 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7FF2A1C6C3; Fri, 8 May 2026 17:05:47 +0200 (CEST) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-mobile-gui 07/20] tree-wide: remove unnecessary lazy evaluations Date: Fri, 8 May 2026 17:05:22 +0200 Message-ID: <20260508150535.420205-8-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260508150535.420205-1-s.sterz@proxmox.com> References: <20260508150535.420205-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778252629782 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.117 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: FYUGYUG5TAZFNAAFR3WGFCPFQODYO4EZ X-Message-ID-Hash: FYUGYUG5TAZFNAAFR3WGFCPFQODYO4EZ X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: fixes the clippy lint "clippy::unnecessary_lazy_evaluations" [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations Signed-off-by: Shannon Sterz --- src/pages/page_dashboard.rs | 2 +- src/pages/page_lxc_status/dashboard_panel.rs | 2 +- src/pages/page_qemu_status/dashboard_panel.rs | 2 +- src/pages/page_resources.rs | 9 +++++---- src/widgets/guest_backup_panel.rs | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/page_dashboard.rs b/src/pages/page_dashboard.rs index ff890ca..519b22e 100644 --- a/src/pages/page_dashboard.rs +++ b/src/pages/page_dashboard.rs @@ -216,7 +216,7 @@ impl PvePageDashboard { icon_list_tile( Fa::new("server").class( (item.status == ClusterNodeIndexResponseStatus::Online) - .then(|| "pwt-color-primary"), + .then_some("pwt-color-primary"), ), nodename.clone(), subtitle.to_string(), diff --git a/src/pages/page_lxc_status/dashboard_panel.rs b/src/pages/page_lxc_status/dashboard_panel.rs index e597116..00fec11 100644 --- a/src/pages/page_lxc_status/dashboard_panel.rs +++ b/src/pages/page_lxc_status/dashboard_panel.rs @@ -82,7 +82,7 @@ fn large_fa_icon(name: &str, running: bool) -> Fa { Fa::new(name) .fixed_width() .class("pwt-font-size-title-large") - .class(running.then(|| "pwt-color-primary")) + .class(running.then_some("pwt-color-primary")) } fn format_guest_task_confirmation( diff --git a/src/pages/page_qemu_status/dashboard_panel.rs b/src/pages/page_qemu_status/dashboard_panel.rs index 47aa89c..27098f4 100644 --- a/src/pages/page_qemu_status/dashboard_panel.rs +++ b/src/pages/page_qemu_status/dashboard_panel.rs @@ -85,7 +85,7 @@ fn large_fa_icon(name: &str, running: bool) -> Fa { Fa::new(name) .fixed_width() .class("pwt-font-size-title-large") - .class(running.then(|| "pwt-color-primary")) + .class(running.then_some("pwt-color-primary")) } fn format_guest_task_confirmation( diff --git a/src/pages/page_resources.rs b/src/pages/page_resources.rs index 1365d63..b20a8e2 100644 --- a/src/pages/page_resources.rs +++ b/src/pages/page_resources.rs @@ -117,7 +117,7 @@ impl PvePageResources { let nodename = item.node.clone().unwrap(); icon_list_tile( Fa::new("server") - .class((item.status.as_deref() == Some("online")).then(|| "pwt-color-primary")), + .class((item.status.as_deref() == Some("online")).then_some("pwt-color-primary")), nodename.clone(), match item.level.as_deref() { Some("") | None => "no subscription", @@ -141,7 +141,7 @@ impl PvePageResources { fn create_vm_list_item(&self, icon: &str, item: &ClusterResource) -> ListTile { icon_list_tile( Fa::new(icon) - .class((item.status.as_deref() == Some("running")).then(|| "pwt-color-primary")), + .class((item.status.as_deref() == Some("running")).then_some("pwt-color-primary")), format!( "{} {}", item.vmid.unwrap(), @@ -187,8 +187,9 @@ impl PvePageResources { let plugin_type = item.plugintype.clone().unwrap(); let mut tile = icon_list_tile( - Fa::new("database") - .class((item.status.as_deref() == Some("available")).then(|| "pwt-color-primary")), + Fa::new("database").class( + (item.status.as_deref() == Some("available")).then_some("pwt-color-primary"), + ), format!("{} ({})", name, plugin_type), item.node.clone(), item.status.clone(), diff --git a/src/widgets/guest_backup_panel.rs b/src/widgets/guest_backup_panel.rs index fac281b..00f211e 100644 --- a/src/widgets/guest_backup_panel.rs +++ b/src/widgets/guest_backup_panel.rs @@ -158,7 +158,7 @@ impl PveGuestBackupPanel { info.total, info.used, ) - .class(active.then(|| pwt::css::ColorScheme::PrimaryContainer)) + .class(active.then_some(pwt::css::ColorScheme::PrimaryContainer)) .class(if active { "pwt-elevation4" } else { -- 2.47.3