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 D13671FF136 for ; Mon, 09 Mar 2026 16:29:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0623F34B; Mon, 9 Mar 2026 16:29:53 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-comp v2 05/13] tree wide: fix clippy lint "unwrap_or_default" Date: Mon, 9 Mar 2026 16:29:30 +0100 Message-ID: <20260309152938.264532-6-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260309152938.264532-1-s.sterz@proxmox.com> References: <20260309152938.264532-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: 1773070153722 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.391 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 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: TGNUXUMBN7L627CSOMIZIAZORFMSIRI2 X-Message-ID-Hash: TGNUXUMBN7L627CSOMIZIAZORFMSIRI2 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#unwrap_or_default Signed-off-by: Shannon Sterz --- src/configuration/pve/lxc_network_panel.rs | 6 +++--- src/configuration/pve/qemu_hardware_panel/desktop.rs | 2 +- src/configuration/pve/qemu_hardware_panel/mobile.rs | 2 +- src/form/pve/lxc_property/lxc_mount_point_property.rs | 2 +- src/form/pve/qemu_property/qemu_disk_property.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/configuration/pve/lxc_network_panel.rs b/src/configuration/pve/lxc_network_panel.rs index 701eb4a..ae42ab1 100644 --- a/src/configuration/pve/lxc_network_panel.rs +++ b/src/configuration/pve/lxc_network_panel.rs @@ -426,7 +426,7 @@ fn columns() -> Rc>> { DataTableColumn::new(tr!("Bridge")) .width("minmax(80px, auto)") .get_property_owned(|item: &NetworkEntry| { - item.config.bridge.clone().unwrap_or(String::new()) + item.config.bridge.clone().unwrap_or_default() }) .into(), DataTableColumn::new(tr!("Firewall")) @@ -448,7 +448,7 @@ fn columns() -> Rc>> { DataTableColumn::new(tr!("VLAN Tag")) .width("minmax(80px, auto)") .render(|item: &NetworkEntry| { - html! { item.config.tag.map(|tag| tag.to_string()).unwrap_or(String::new())} + html! { item.config.tag.map(|tag| tag.to_string()).unwrap_or_default()} }) .into(), DataTableColumn::new(tr!("MAC address")) @@ -472,7 +472,7 @@ fn columns() -> Rc>> { DataTableColumn::new(tr!("MTU")) .width("minmax(80px, auto)") .render(|item: &NetworkEntry| { - html! { item.config.mtu.map(|mtu| mtu.to_string()).unwrap_or(String::new())} + html! { item.config.mtu.map(|mtu| mtu.to_string()).unwrap_or_default()} }) .into(), DataTableColumn::new(tr!("Disconnected")) diff --git a/src/configuration/pve/qemu_hardware_panel/desktop.rs b/src/configuration/pve/qemu_hardware_panel/desktop.rs index 9bc33fb..4f9b747 100644 --- a/src/configuration/pve/qemu_hardware_panel/desktop.rs +++ b/src/configuration/pve/qemu_hardware_panel/desktop.rs @@ -425,7 +425,7 @@ impl PendingPropertyView for PveQemuHardwarePanel { let username = crate::http_get_auth() .map(|info| info.userid.clone()) - .unwrap_or(String::new()); + .unwrap_or_default(); let user_is_root = props.remote.is_none() && username == "root@pam"; let PvePendingConfiguration { diff --git a/src/configuration/pve/qemu_hardware_panel/mobile.rs b/src/configuration/pve/qemu_hardware_panel/mobile.rs index 9946ce1..46b33e4 100644 --- a/src/configuration/pve/qemu_hardware_panel/mobile.rs +++ b/src/configuration/pve/qemu_hardware_panel/mobile.rs @@ -742,7 +742,7 @@ impl PendingPropertyView for PveQemuHardwarePanel { let username = crate::http_get_auth() .map(|info| info.userid.clone()) - .unwrap_or(String::new()); + .unwrap_or_default(); let user_is_root = props.remote.is_none() && username == "root@pam"; let editor_url = 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 b6ed449..c0dd36f 100644 --- a/src/form/pve/lxc_property/lxc_mount_point_property.rs +++ b/src/form/pve/lxc_property/lxc_mount_point_property.rs @@ -81,7 +81,7 @@ impl MountPointComp { .map(|s| s.to_string()) }) .flatten() - .unwrap_or(String::new()); + .unwrap_or_default(); self.used_mount_points = extract_used_mount_points(&props.state.record); diff --git a/src/form/pve/qemu_property/qemu_disk_property.rs b/src/form/pve/qemu_property/qemu_disk_property.rs index dc9ec47..9c8f7e0 100644 --- a/src/form/pve/qemu_property/qemu_disk_property.rs +++ b/src/form/pve/qemu_property/qemu_disk_property.rs @@ -118,7 +118,7 @@ impl DiskPanelComp { .map(|s| s.to_string()) }) .flatten() - .unwrap_or(String::new()); + .unwrap_or_default(); self.used_devices = extract_used_devices(&props.state.record); } -- 2.47.3