From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B818B1FF13E for ; Fri, 06 Mar 2026 12:20:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 31E931F7CD; Fri, 6 Mar 2026 12:22:00 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-comp 07/15] tree wide: fix clippy lint "collapsible_else_if" Date: Fri, 6 Mar 2026 12:21:39 +0100 Message-ID: <20260306112148.208189-8-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: 1772796082645 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.398 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: FN4K5B3NGKD322S6ZWKIYGTBQKIXVCP2 X-Message-ID-Hash: FN4K5B3NGKD322S6ZWKIYGTBQKIXVCP2 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#collapsible_else_if Signed-off-by: Shannon Sterz --- 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