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 025141FF13E for ; Fri, 06 Mar 2026 12:21:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9CEE91F9D4; Fri, 6 Mar 2026 12:22:27 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-comp 04/15] tree wide: fix clippy lint "unnecessary_lazy_evaluations" Date: Fri, 6 Mar 2026 12:21:36 +0100 Message-ID: <20260306112148.208189-5-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260306112148.208189-1-s.sterz@proxmox.com> References: <20260306112148.208189-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: 1772796082344 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.404 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 RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLACK 3 Contains an URL listed in the URIBL blacklist [rust-lang.github.io] Message-ID-Hash: BIETQHOU6LAEMYIAHAGDVXUQQBUNI2VD X-Message-ID-Hash: BIETQHOU6LAEMYIAHAGDVXUQQBUNI2VD 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: see: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations Signed-off-by: Shannon Sterz --- src/configuration/pve/firewall/firewall_rules_panel.rs | 2 +- .../pve/lxc_resources_panel/reassign_volume_dialog.rs | 2 +- .../pve/qemu_hardware_panel/reassign_disk_dialog.rs | 2 +- src/form/pve/lxc_property/lxc_features_property.rs | 2 +- src/form/pve/lxc_property/lxc_network_property.rs | 2 +- src/form/pve/pve_guest_selector.rs | 2 +- src/form/pve/qemu_property/mod.rs | 2 +- src/form/pve/qemu_property/qemu_amd_sev_property.rs | 2 +- src/form/pve/qemu_property/qemu_display_property.rs | 2 +- src/form/pve/qemu_property/qemu_intel_tdx_property.rs | 2 +- src/form/pve/qemu_property/qemu_processor_property.rs | 2 +- src/form/pve/qemu_property/qemu_scsihw_property.rs | 2 +- src/form/pve/qemu_property/qemu_smbios1_property.rs | 2 +- src/layout/mobile_form.rs | 2 +- src/property_edit_dialog.rs | 4 ++-- src/property_view/mod.rs | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/configuration/pve/firewall/firewall_rules_panel.rs b/src/configuration/pve/firewall/firewall_rules_panel.rs index 948866d..56d687e 100644 --- a/src/configuration/pve/firewall/firewall_rules_panel.rs +++ b/src/configuration/pve/firewall/firewall_rules_panel.rs @@ -279,7 +279,7 @@ fn render_firewall_rule_mobile(rule: &ListFirewallRules) -> Html { .with_child( Container::new().with_child( Container::new() - .style("opacity", (rule.enable != Some(1)).then(|| "0.5")) + .style("opacity", (rule.enable != Some(1)).then_some("0.5")) .with_child(&rule.action), ), ) diff --git a/src/configuration/pve/lxc_resources_panel/reassign_volume_dialog.rs b/src/configuration/pve/lxc_resources_panel/reassign_volume_dialog.rs index 8345b72..d7c7389 100644 --- a/src/configuration/pve/lxc_resources_panel/reassign_volume_dialog.rs +++ b/src/configuration/pve/lxc_resources_panel/reassign_volume_dialog.rs @@ -162,7 +162,7 @@ impl Component for LxcReassignVolumeComp { InputPanel::new() .mobile(props.mobile) - .field_width((!props.mobile).then(|| "300px")) + .field_width((!props.mobile).then_some("300px")) .class(pwt::css::FlexFit) .padding_x(2) .padding_bottom(1) // avoid scrollbar diff --git a/src/configuration/pve/qemu_hardware_panel/reassign_disk_dialog.rs b/src/configuration/pve/qemu_hardware_panel/reassign_disk_dialog.rs index c0122eb..600b095 100644 --- a/src/configuration/pve/qemu_hardware_panel/reassign_disk_dialog.rs +++ b/src/configuration/pve/qemu_hardware_panel/reassign_disk_dialog.rs @@ -112,7 +112,7 @@ impl Component for QemuReassignDiskPanelComp { InputPanel::new() .mobile(props.mobile) - .field_width((!props.mobile).then(|| "300px")) + .field_width((!props.mobile).then_some("300px")) .class(pwt::css::FlexFit) .padding_x(2) .padding_bottom(1) // avoid scrollbar diff --git a/src/form/pve/lxc_property/lxc_features_property.rs b/src/form/pve/lxc_property/lxc_features_property.rs index e969e26..3c712d1 100644 --- a/src/form/pve/lxc_property/lxc_features_property.rs +++ b/src/form/pve/lxc_property/lxc_features_property.rs @@ -85,7 +85,7 @@ impl Component for LxcFeaturesComp { .class(pwt::css::FlexFit) .padding_x(2) .padding_bottom(1) // avoid scrollbar - .label_width((!props.mobile).then(|| "max-content")) + .label_width((!props.mobile).then_some("max-content")) .with_single_line_field( false, false, diff --git a/src/form/pve/lxc_property/lxc_network_property.rs b/src/form/pve/lxc_property/lxc_network_property.rs index 79dd675..d33267b 100644 --- a/src/form/pve/lxc_property/lxc_network_property.rs +++ b/src/form/pve/lxc_property/lxc_network_property.rs @@ -218,7 +218,7 @@ fn input_panel( .mobile(mobile) .show_advanced(advanced) .padding_x(2) - .field_width((!mobile).then(|| "300px")) + .field_width((!mobile).then_some("300px")) .with_field(name_label, name_field) .with_field(hwaddr_label, hwaddr_field) .with_field(bridge_label, bridge_field) diff --git a/src/form/pve/pve_guest_selector.rs b/src/form/pve/pve_guest_selector.rs index f55a6a9..f4ff7ab 100644 --- a/src/form/pve/pve_guest_selector.rs +++ b/src/form/pve/pve_guest_selector.rs @@ -235,7 +235,7 @@ fn columns_mobile() -> Rc>> { .class(pwt::css::AlignItems::Center) .gap(2) .with_child(Fa::new(icon).large_2x().class( - (item.status.as_deref() == Some("running")).then(|| "pwt-color-primary"), + (item.status.as_deref() == Some("running")).then_some("pwt-color-primary"), )) .with_child(title_subtitle_column(title, item.node.clone())) .with_flex_spacer() diff --git a/src/form/pve/qemu_property/mod.rs b/src/form/pve/qemu_property/mod.rs index a1bb48c..523b845 100644 --- a/src/form/pve/qemu_property/mod.rs +++ b/src/form/pve/qemu_property/mod.rs @@ -219,7 +219,7 @@ pub fn qemu_startup_property(mobile: bool) -> EditableProperty { .mobile(mobile) .class(pwt::css::FlexFit) .padding_x(2) - .style("min-width", (!mobile).then(|| "500px")) + .style("min-width", (!mobile).then_some("500px")) .with_field(order_label, order_field) .with_field(up_label, up_field) .with_field(down_label, down_field) diff --git a/src/form/pve/qemu_property/qemu_amd_sev_property.rs b/src/form/pve/qemu_property/qemu_amd_sev_property.rs index 9ec7683..267b708 100644 --- a/src/form/pve/qemu_property/qemu_amd_sev_property.rs +++ b/src/form/pve/qemu_property/qemu_amd_sev_property.rs @@ -89,7 +89,7 @@ fn input_panel(mobile: bool) -> RenderPropertyInputPanelFn { .mobile(mobile) .show_advanced(advanced) .label_width("max-content") - .field_width((!mobile).then(|| "350px")) + .field_width((!mobile).then_some("350px")) .class(pwt::css::FlexFit) .padding_x(2) .padding_bottom(1) // avoid scrollbar diff --git a/src/form/pve/qemu_property/qemu_display_property.rs b/src/form/pve/qemu_property/qemu_display_property.rs index 3afb1e6..0ba9b4b 100644 --- a/src/form/pve/qemu_property/qemu_display_property.rs +++ b/src/form/pve/qemu_property/qemu_display_property.rs @@ -135,7 +135,7 @@ impl Component for StatefulPanelComp { InputPanel::new() .mobile(props.mobile) - .style("min-width", (!props.mobile).then(|| "400px")) + .style("min-width", (!props.mobile).then_some("400px")) .show_advanced(advanced) .class(pwt::css::FlexFit) .padding_x(2) diff --git a/src/form/pve/qemu_property/qemu_intel_tdx_property.rs b/src/form/pve/qemu_property/qemu_intel_tdx_property.rs index d8ca8f0..f99af5d 100644 --- a/src/form/pve/qemu_property/qemu_intel_tdx_property.rs +++ b/src/form/pve/qemu_property/qemu_intel_tdx_property.rs @@ -70,7 +70,7 @@ fn input_panel(mobile: bool) -> RenderPropertyInputPanelFn { .mobile(mobile) .show_advanced(advanced) .label_width("max-content") - .field_width((!mobile).then(|| "350px")) + .field_width((!mobile).then_some("350px")) .class(pwt::css::FlexFit) .padding_x(2) .padding_bottom(1) // avoid scrollbar diff --git a/src/form/pve/qemu_property/qemu_processor_property.rs b/src/form/pve/qemu_property/qemu_processor_property.rs index 280879e..25ca465 100644 --- a/src/form/pve/qemu_property/qemu_processor_property.rs +++ b/src/form/pve/qemu_property/qemu_processor_property.rs @@ -144,7 +144,7 @@ fn processor_input_panel( .with_child( Column::new() .class(pwt::css::FlexFit) - .class((!advanced).then(|| pwt::css::Display::None)) + .class((!advanced).then_some(pwt::css::Display::None)) .with_child(Row::new().padding_y(2).with_child(scheduler_view)) .with_child( Container::new() diff --git a/src/form/pve/qemu_property/qemu_scsihw_property.rs b/src/form/pve/qemu_property/qemu_scsihw_property.rs index 774db55..a81f5aa 100644 --- a/src/form/pve/qemu_property/qemu_scsihw_property.rs +++ b/src/form/pve/qemu_property/qemu_scsihw_property.rs @@ -46,7 +46,7 @@ pub fn qemu_scsihw_property(mobile: bool) -> EditableProperty { let mut panel = InputPanel::new() .mobile(mobile) .class(pwt::css::FlexFit) - .field_width((!mobile).then(|| "250px")) + .field_width((!mobile).then_some("250px")) .padding_x(2) .padding_bottom(1); // avoid scrollbar ?! diff --git a/src/form/pve/qemu_property/qemu_smbios1_property.rs b/src/form/pve/qemu_property/qemu_smbios1_property.rs index 421b0ce..2ec4df6 100644 --- a/src/form/pve/qemu_property/qemu_smbios1_property.rs +++ b/src/form/pve/qemu_property/qemu_smbios1_property.rs @@ -78,7 +78,7 @@ fn input_panel(mobile: bool) -> RenderPropertyInputPanelFn { InputPanel::new() .mobile(mobile) - .field_width((!mobile).then(|| "300px")) + .field_width((!mobile).then_some("300px")) .class(pwt::css::FlexFit) .padding_x(2) .with_field(uuid_label, uuid_field) diff --git a/src/layout/mobile_form.rs b/src/layout/mobile_form.rs index 1f78885..08e56aa 100644 --- a/src/layout/mobile_form.rs +++ b/src/layout/mobile_form.rs @@ -26,7 +26,7 @@ pub fn label_field( .into() .id(label_id.clone()) .padding_bottom(PwtSpace::Em(0.3)) - .class((!enabled).then(|| "pwt-label-disabled")), + .class((!enabled).then_some("pwt-label-disabled")), ) .with_child(field.label_id(label_id).disabled(!enabled)) } diff --git a/src/property_edit_dialog.rs b/src/property_edit_dialog.rs index 738f905..947c967 100644 --- a/src/property_edit_dialog.rs +++ b/src/property_edit_dialog.rs @@ -426,9 +426,9 @@ impl Component for PwtPropertyEditDialog { .style("position", "absolute") .style("left", "0") .style("right", "0") - .style("visibility", (!loading).then(|| "hidden")), + .style("visibility", (!loading).then_some("hidden")), ) - .with_child(form.style("visibility", loading.then(|| "hidden"))); + .with_child(form.style("visibility", loading.then_some("hidden"))); let on_close = { let on_close = props.on_close.clone(); diff --git a/src/property_view/mod.rs b/src/property_view/mod.rs index 2d86415..1bb08ab 100644 --- a/src/property_view/mod.rs +++ b/src/property_view/mod.rs @@ -248,7 +248,7 @@ pub fn render_loadable_panel( .style("position", "absolute") .style("left", "0") .style("right", "0") - .style("visibility", (!loading).then(|| "hidden")), + .style("visibility", (!loading).then_some("hidden")), ) .with_child(panel) .with_optional_child( -- 2.47.3