all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [PATCH yew-comp v2 07/13] tree wide: fix clippy lint "collapsible_else_if"
Date: Mon,  9 Mar 2026 16:29:32 +0100	[thread overview]
Message-ID: <20260309152938.264532-8-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#collapsible_else_if
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/form/pve/hotplug_feature_selector.rs      |  8 +++----
 .../lxc_property/lxc_mount_point_property.rs  | 24 ++++++++-----------
 .../pve/qemu_property/qemu_disk_property.rs   | 16 +++++--------
 3 files changed, 19 insertions(+), 29 deletions(-)

diff --git a/src/form/pve/hotplug_feature_selector.rs b/src/form/pve/hotplug_feature_selector.rs
index 45e4166..c0322d0 100644
--- a/src/form/pve/hotplug_feature_selector.rs
+++ b/src/form/pve/hotplug_feature_selector.rs
@@ -85,12 +85,10 @@ pub fn normalize_hotplug_value(value: &Value) -> Value {
         Value::String(s) => {
             if s == "0" {
                 "".into()
+            } else if s == "1" {
+                "disk,network,usb".into()
             } else {
-                if s == "1" {
-                    "disk,network,usb".into()
-                } else {
-                    s.clone().into()
-                }
+                s.clone().into()
             }
         }
         _ => value.clone(),
diff --git a/src/form/pve/lxc_property/lxc_mount_point_property.rs b/src/form/pve/lxc_property/lxc_mount_point_property.rs
index 379577d..f02d84f 100644
--- a/src/form/pve/lxc_property/lxc_mount_point_property.rs
+++ b/src/form/pve/lxc_property/lxc_mount_point_property.rs
@@ -267,14 +267,12 @@ impl Component for MountPointComp {
             if props.unused_disk.is_some() {
                 panel.add_custom_child(file_info_child);
                 panel.add_field(mount_point_id_label, mount_point_id_field);
+            } else if self.is_create {
+                panel.add_field(mount_point_id_label, mount_point_id_field);
+                panel.add_field(storage_label, storage_field);
+                panel.add_field(disk_size_label, disk_size_field);
             } else {
-                if self.is_create {
-                    panel.add_field(mount_point_id_label, mount_point_id_field);
-                    panel.add_field(storage_label, storage_field);
-                    panel.add_field(disk_size_label, disk_size_field);
-                } else {
-                    panel.add_custom_child(file_info_child);
-                }
+                panel.add_custom_child(file_info_child);
             }
 
             if !props.rootfs {
@@ -309,14 +307,12 @@ impl Component for MountPointComp {
             if props.unused_disk.is_some() {
                 panel.add_field(mount_point_id_label, mount_point_id_field);
                 panel.add_custom_child(file_info_child);
+            } else if self.is_create {
+                panel.add_field(mount_point_id_label, mount_point_id_field);
+                panel.add_field(storage_label, storage_field);
+                panel.add_field(disk_size_label, disk_size_field);
             } else {
-                if self.is_create {
-                    panel.add_field(mount_point_id_label, mount_point_id_field);
-                    panel.add_field(storage_label, storage_field);
-                    panel.add_field(disk_size_label, disk_size_field);
-                } else {
-                    panel.add_custom_child(file_info_child);
-                }
+                panel.add_custom_child(file_info_child);
             }
 
             if !props.rootfs {
diff --git a/src/form/pve/qemu_property/qemu_disk_property.rs b/src/form/pve/qemu_property/qemu_disk_property.rs
index 9c8f7e0..dfdf9ea 100644
--- a/src/form/pve/qemu_property/qemu_disk_property.rs
+++ b/src/form/pve/qemu_property/qemu_disk_property.rs
@@ -297,12 +297,10 @@ impl Component for DiskPanelComp {
             if props.unused_disk.is_some() {
                 panel.add_custom_child(file_info_child);
                 add_bus_device_selector(&mut panel);
+            } else if self.is_create {
+                add_bus_device_selector(&mut panel);
             } else {
-                if self.is_create {
-                    add_bus_device_selector(&mut panel);
-                } else {
-                    panel.add_custom_child(file_info_child);
-                }
+                panel.add_custom_child(file_info_child);
             }
 
             panel.add_field(cache_label, cache_field);
@@ -340,12 +338,10 @@ impl Component for DiskPanelComp {
                         .read_only(true)
                         .value(self.unused_volume.clone()),
                 );
+            } else if self.is_create {
+                add_bus_device_selector(&mut panel);
             } else {
-                if self.is_create {
-                    add_bus_device_selector(&mut panel);
-                } else {
-                    panel.add_custom_child(file_info_child);
-                }
+                panel.add_custom_child(file_info_child);
             }
 
             panel.add_right_field(cache_label, cache_field);
-- 
2.47.3





  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 ` [PATCH yew-comp v2 04/13] tree wide: fix clippy lint "unnecessary_lazy_evaluations" Shannon Sterz
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 ` Shannon Sterz [this message]
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-8-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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal