public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 2/2] ui: use new `iter()` method of ArrayMap properties
Date: Thu, 16 Jan 2025 10:22:27 +0100	[thread overview]
Message-ID: <20250116092227.991075-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250116092227.991075-1-d.csapak@proxmox.com>

they now can be directly referenced with that, instead of going over the
ArrayMap `Deref` and using `.into_iter()`.

Makes the code a bit clearer since the ref/deref syntax looks a bit
strange.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 ui/src/pve/utils.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ui/src/pve/utils.rs b/ui/src/pve/utils.rs
index 3cb45a9..bb02f56 100644
--- a/ui/src/pve/utils.rs
+++ b/ui/src/pve/utils.rs
@@ -152,7 +152,7 @@ pub fn foreach_drive_qemu<F>(config: &QemuConfig, mut f: F)
 where
     F: FnMut(&str, Result<PveDriveQemu, Error>),
 {
-    for (idx, value) in (&*config.ide).into_iter() {
+    for (idx, value) in config.ide.iter() {
         let key = format!("ide{idx}");
         let res = value
             .parse::<PropertyString<PveQmIde>>()
@@ -160,7 +160,7 @@ where
         f(&key, res.map_err(Error::from));
     }
 
-    for (idx, value) in (&*config.sata).into_iter() {
+    for (idx, value) in config.sata.iter() {
         let key = format!("sata{idx}");
         let res = value
             .parse::<PropertyString<QemuConfigSata>>()
@@ -168,7 +168,7 @@ where
         f(&key, res.map_err(Error::from));
     }
 
-    for (idx, value) in (&*config.scsi).into_iter() {
+    for (idx, value) in config.scsi.iter() {
         let key = format!("scsi{idx}");
         let res = value
             .parse::<PropertyString<QemuConfigScsi>>()
@@ -176,7 +176,7 @@ where
         f(&key, res.map_err(Error::from));
     }
 
-    for (idx, value) in (&*config.virtio).into_iter() {
+    for (idx, value) in config.virtio.iter() {
         let key = format!("virtio{idx}");
         let res = value
             .parse::<PropertyString<QemuConfigVirtio>>()
@@ -184,7 +184,7 @@ where
         f(&key, res.map_err(Error::from));
     }
 
-    for (idx, value) in (&*config.unused).into_iter() {
+    for (idx, value) in config.unused.iter() {
         let key = format!("unused{idx}");
         let res = value
             .parse::<PropertyString<QemuConfigUnused>>()
@@ -224,7 +224,7 @@ where
         f(key, res.map_err(Error::from));
     }
 
-    for (idx, value) in (&*config.mp).into_iter() {
+    for (idx, value) in config.mp.iter() {
         let key = format!("mp{idx}");
         let res = value
             .parse::<PropertyString<LxcConfigMp>>()
@@ -232,7 +232,7 @@ where
         f(&key, res.map_err(Error::from));
     }
 
-    for (idx, value) in (&*config.unused).into_iter() {
+    for (idx, value) in config.unused.iter() {
         let key = format!("unused{idx}");
         let res = value
             .parse::<PropertyString<LxcConfigUnused>>()
-- 
2.39.5



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-01-16  9:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16  9:22 [pdm-devel] [PATCH datacenter-manager 1/2] ui: use better schema handling of `keyAlias` property strings Dominik Csapak
2025-01-16  9:22 ` Dominik Csapak [this message]
2025-01-16  9:58 ` [pdm-devel] applied: " Dietmar Maurer

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=20250116092227.991075-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-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