From: Shannon Sterz <s.sterz@proxmox.com>
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 [thread overview]
Message-ID: <20260306112148.208189-5-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260306112148.208189-1-s.sterz@proxmox.com>
see:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
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<Vec<DataTableHeader<ClusterResource>>> {
.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
next prev parent reply other threads:[~2026-03-06 11:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 11:21 [PATCH yew-comp 00/15] clippy clean up proxmox-yew-comp Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 01/15] tree wide: fix clippy lint "useless_conversion" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 02/15] tree wide: fix clippy lint "new_without_default" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 03/15] tree wide: fix clippy lint "redundant_static_lifetimes" Shannon Sterz
2026-03-06 11:21 ` Shannon Sterz [this message]
2026-03-06 11:21 ` [PATCH yew-comp 05/15] tree wide: fix clippy lint "unwrap_or_default" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 06/15] tree wide: fix clippy lint "clone_on_copy" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 07/15] tree wide: fix clippy lint "collapsible_else_if" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 08/15] tree wide: fix various minor clippy lints Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 09/15] tree wide: fix clippy lint "manual_strip" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 10/15] lxc_property/qemu_property: fix clippy lint "match_like_matches_macro" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 11/15] firewall_property: fix clippy lint "redundant_guards" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 12/15] qemu_property: fix clippy lint "redundant_pattern_matching" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 13/15] qemu_hardware_pane/lxc_resources_panel: allow clippy::enum_variant_names Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 14/15] tree wide: fix clippy lint "large_enum_variant" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 15/15] tree wide: allow clippy "too_many_arguments" warning selectively Shannon Sterz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260306112148.208189-5-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=yew-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox