public inbox for yew-devel@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 05/15] tree wide: fix clippy lint "unwrap_or_default"
Date: Fri,  6 Mar 2026 12:21:37 +0100	[thread overview]
Message-ID: <20260306112148.208189-6-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260306112148.208189-1-s.sterz@proxmox.com>

see:
https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 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<Vec<DataTableHeader<NetworkEntry>>> {
         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<Vec<DataTableHeader<NetworkEntry>>> {
         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<Vec<DataTableHeader<NetworkEntry>>> {
         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





  parent reply	other threads:[~2026-03-06 11:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 11:21 [PATCH yew-comp 00/15] clippy clean up proxmox-yew-comp Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 01/15] tree wide: fix clippy lint "useless_conversion" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 02/15] tree wide: fix clippy lint "new_without_default" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 03/15] tree wide: fix clippy lint "redundant_static_lifetimes" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 04/15] tree wide: fix clippy lint "unnecessary_lazy_evaluations" Shannon Sterz
2026-03-06 11:21 ` Shannon Sterz [this message]
2026-03-06 11:21 ` [PATCH yew-comp 06/15] tree wide: fix clippy lint "clone_on_copy" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 07/15] tree wide: fix clippy lint "collapsible_else_if" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 08/15] tree wide: fix various minor clippy lints Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 09/15] tree wide: fix clippy lint "manual_strip" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 10/15] lxc_property/qemu_property: fix clippy lint "match_like_matches_macro" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 11/15] firewall_property: fix clippy lint "redundant_guards" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 12/15] qemu_property: fix clippy lint "redundant_pattern_matching" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 13/15] qemu_hardware_pane/lxc_resources_panel: allow clippy::enum_variant_names Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 14/15] tree wide: fix clippy lint "large_enum_variant" Shannon Sterz
2026-03-06 11:21 ` [PATCH yew-comp 15/15] tree wide: allow clippy "too_many_arguments" warning selectively 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=20260306112148.208189-6-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal