From: Shannon Sterz <s.sterz@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [PATCH yew-comp v2 04/13] tree wide: fix clippy lint "unnecessary_lazy_evaluations"
Date: Mon, 9 Mar 2026 16:29:29 +0100 [thread overview]
Message-ID: <20260309152938.264532-5-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260309152938.264532-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-09 15:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 15:29 [PATCH yew-comp v2 00/13] clippy clean up for proxmox-yew-comp Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 01/13] tree wide: fix clippy lint "useless_conversion" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 02/13] tree wide: fix clippy lint "new_without_default" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 03/13] tree wide: fix clippy lint "redundant_static_lifetimes" Shannon Sterz
2026-03-09 15:29 ` Shannon Sterz [this message]
2026-03-09 15:29 ` [PATCH yew-comp v2 05/13] tree wide: fix clippy lint "unwrap_or_default" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 06/13] tree wide: fix clippy lint "clone_on_copy" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 07/13] tree wide: fix clippy lint "collapsible_else_if" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 08/13] tree wide: fix various minor clippy lints Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 09/13] tree wide: fix clippy lint "manual_strip" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 10/13] lxc_property/qemu_property: fix clippy lint "match_like_matches_macro" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 11/13] firewall_property: fix clippy lint "redundant_guards" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 12/13] qemu_property: fix clippy lint "redundant_pattern_matching" Shannon Sterz
2026-03-09 15:29 ` [PATCH yew-comp v2 13/13] cargo.toml: globally ignore certain clippy lints 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=20260309152938.264532-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.