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 3990E1FF13E for ; Fri, 06 Mar 2026 12:20:50 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 27D021F73B; Fri, 6 Mar 2026 12:21:56 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-comp 01/15] tree wide: fix clippy lint "useless_conversion" Date: Fri, 6 Mar 2026 12:21:33 +0100 Message-ID: <20260306112148.208189-2-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: 1772796082121 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.405 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: FMMKD336WOZUY65WNOORUKTYWOSLX6Y5 X-Message-ID-Hash: FMMKD336WOZUY65WNOORUKTYWOSLX6Y5 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#useless_conversion Signed-off-by: Shannon Sterz --- src/configuration/pve/lxc_network_panel.rs | 2 +- src/configuration/pve/lxc_resources_panel/desktop.rs | 2 +- src/configuration/pve/qemu_hardware_panel/desktop.rs | 2 +- src/editable_property.rs | 2 +- src/form/pve/firewall_property/log_ratelimit_property.rs | 1 - src/form/pve/qemu_disk_format_selector.rs | 3 +-- src/form/pve/qemu_property/qemu_memory_property.rs | 4 ++-- src/layout/mobile_form.rs | 2 -- src/property_view/mod.rs | 4 ++-- 9 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/configuration/pve/lxc_network_panel.rs b/src/configuration/pve/lxc_network_panel.rs index 34c8fa8..701eb4a 100644 --- a/src/configuration/pve/lxc_network_panel.rs +++ b/src/configuration/pve/lxc_network_panel.rs @@ -73,7 +73,7 @@ struct NetworkEntry { impl ExtractPrimaryKey for NetworkEntry { fn extract_key(&self) -> Key { - Key::from(self.key.clone()) + self.key.clone() } } diff --git a/src/configuration/pve/lxc_resources_panel/desktop.rs b/src/configuration/pve/lxc_resources_panel/desktop.rs index 72b77fd..2b16133 100644 --- a/src/configuration/pve/lxc_resources_panel/desktop.rs +++ b/src/configuration/pve/lxc_resources_panel/desktop.rs @@ -58,7 +58,7 @@ struct ResourceEntry { impl ExtractPrimaryKey for ResourceEntry { fn extract_key(&self) -> Key { - Key::from(self.key.clone()) + self.key.clone() } } diff --git a/src/configuration/pve/qemu_hardware_panel/desktop.rs b/src/configuration/pve/qemu_hardware_panel/desktop.rs index 5ad1114..9bc33fb 100644 --- a/src/configuration/pve/qemu_hardware_panel/desktop.rs +++ b/src/configuration/pve/qemu_hardware_panel/desktop.rs @@ -63,7 +63,7 @@ struct HardwareEntry { impl ExtractPrimaryKey for HardwareEntry { fn extract_key(&self) -> Key { - Key::from(self.key.clone()) + self.key.clone() } } diff --git a/src/editable_property.rs b/src/editable_property.rs index 4d9d459..b1e124c 100644 --- a/src/editable_property.rs +++ b/src/editable_property.rs @@ -135,7 +135,7 @@ impl EditableProperty { pub fn new(name: impl IntoPropValue>, title: impl Into) -> Self { let name = name.into_prop_value(); Self { - name: name.into(), + name: name, revert_keys: None, title: title.into(), required: false, diff --git a/src/form/pve/firewall_property/log_ratelimit_property.rs b/src/form/pve/firewall_property/log_ratelimit_property.rs index e58078d..2dbbaad 100644 --- a/src/form/pve/firewall_property/log_ratelimit_property.rs +++ b/src/form/pve/firewall_property/log_ratelimit_property.rs @@ -89,5 +89,4 @@ pub fn log_ratelimit_property(mobile: bool) -> EditableProperty { let form_data = delete_empty_values(&form_data, &[LOG_RATELIMIT_PN], false); Ok(form_data) }) - .into() } diff --git a/src/form/pve/qemu_disk_format_selector.rs b/src/form/pve/qemu_disk_format_selector.rs index 8106bcb..3468dd8 100644 --- a/src/form/pve/qemu_disk_format_selector.rs +++ b/src/form/pve/qemu_disk_format_selector.rs @@ -114,8 +114,7 @@ impl Component for QemuDiskFormatComp { .min_width(300) .show_header(false) .header_focusable(false) - .class(pwt::css::FlexFit) - .into(), + .class(pwt::css::FlexFit), ) .selection(args.selection.clone()) .on_select(args.controller.on_select_callback()) diff --git a/src/form/pve/qemu_property/qemu_memory_property.rs b/src/form/pve/qemu_property/qemu_memory_property.rs index e057fe5..9a8d50a 100644 --- a/src/form/pve/qemu_property/qemu_memory_property.rs +++ b/src/form/pve/qemu_property/qemu_memory_property.rs @@ -185,7 +185,7 @@ pub fn qemu_memory_property(mobile: bool) -> EditableProperty { if balloon == old_memory && old_memory != current_memory { form_ctx .write() - .set_field_value("balloon", current_memory.clone().into()); + .set_field_value("balloon", current_memory.clone()); } } _ => {} @@ -194,7 +194,7 @@ pub fn qemu_memory_property(mobile: bool) -> EditableProperty { if let Some(current_memory) = current_memory { form_ctx .write() - .set_field_value("_old_memory", current_memory.into()); + .set_field_value("_old_memory", current_memory); } }) } diff --git a/src/layout/mobile_form.rs b/src/layout/mobile_form.rs index 04f4a62..1f78885 100644 --- a/src/layout/mobile_form.rs +++ b/src/layout/mobile_form.rs @@ -7,7 +7,6 @@ pub fn label_widget(label: impl Into, field: impl Into) -> Colu Column::new() .with_child(FieldLabel::new(label.into()).padding_bottom(PwtSpace::Em(0.3))) .with_child(field) - .into() } /// Column with label and field @@ -30,5 +29,4 @@ pub fn label_field( .class((!enabled).then(|| "pwt-label-disabled")), ) .with_child(field.label_id(label_id).disabled(!enabled)) - .into() } diff --git a/src/property_view/mod.rs b/src/property_view/mod.rs index 39382f0..2d86415 100644 --- a/src/property_view/mod.rs +++ b/src/property_view/mod.rs @@ -31,7 +31,7 @@ pub struct PropertyGridRecord { impl ExtractPrimaryKey for PropertyGridRecord { fn extract_key(&self) -> Key { - Key::from(self.key.clone()) + self.key.clone() } } @@ -276,7 +276,7 @@ pub fn render_property_value(record: &Value, property: &EditableProperty) -> Htm match value { None::<_> | Some(Value::Null) => { let placeholder = if let Some(placeholder) = &property.placeholder { - placeholder.to_string().into() + placeholder.to_string() } else { String::from("-") }; -- 2.47.3