public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH 2/4] stop using captures trick
Date: Mon, 31 Mar 2025 15:51:29 +0200	[thread overview]
Message-ID: <20250331135131.127561-2-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20250331135131.127561-1-m.sandoval@proxmox.com>

See https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxmox-ve-config/src/firewall/bridge.rs |  2 +-
 proxmox-ve-config/src/sdn/config.rs      | 12 ++++++------
 proxmox-ve-config/src/sdn/ipam.rs        |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/proxmox-ve-config/src/firewall/bridge.rs b/proxmox-ve-config/src/firewall/bridge.rs
index 4acb6fa..3a1fc30 100644
--- a/proxmox-ve-config/src/firewall/bridge.rs
+++ b/proxmox-ve-config/src/firewall/bridge.rs
@@ -36,7 +36,7 @@ impl Config {
         self.config.options.enable.unwrap_or(BRIDGE_ENABLED_DEFAULT)
     }
 
-    pub fn rules(&self) -> impl Iterator<Item = &Rule> + '_ {
+    pub fn rules(&self) -> impl Iterator<Item = &Rule> {
         self.config.rules.iter()
     }
 
diff --git a/proxmox-ve-config/src/sdn/config.rs b/proxmox-ve-config/src/sdn/config.rs
index 7ee1101..dc90f0f 100644
--- a/proxmox-ve-config/src/sdn/config.rs
+++ b/proxmox-ve-config/src/sdn/config.rs
@@ -288,7 +288,7 @@ impl SubnetConfig {
         self.name.cidr()
     }
 
-    pub fn dhcp_ranges(&self) -> impl Iterator<Item = &IpRange> + '_ {
+    pub fn dhcp_ranges(&self) -> impl Iterator<Item = &IpRange> {
         self.dhcp_range.iter()
     }
 }
@@ -332,7 +332,7 @@ impl VnetConfig {
         Ok(self.subnets.insert(*subnet.cidr(), subnet))
     }
 
-    pub fn subnets(&self) -> impl Iterator<Item = &SubnetConfig> + '_ {
+    pub fn subnets(&self) -> impl Iterator<Item = &SubnetConfig> {
         self.subnets.values()
     }
 
@@ -385,7 +385,7 @@ impl ZoneConfig {
         Ok(self.vnets.insert(vnet.name.clone(), vnet))
     }
 
-    pub fn vnets(&self) -> impl Iterator<Item = &VnetConfig> + '_ {
+    pub fn vnets(&self) -> impl Iterator<Item = &VnetConfig> {
         self.vnets.values()
     }
 
@@ -510,7 +510,7 @@ impl SdnConfig {
         self.zones.get(name)
     }
 
-    pub fn zones(&self) -> impl Iterator<Item = &ZoneConfig> + '_ {
+    pub fn zones(&self) -> impl Iterator<Item = &ZoneConfig> {
         self.zones.values()
     }
 
@@ -525,7 +525,7 @@ impl SdnConfig {
         None
     }
 
-    pub fn vnets(&self) -> impl Iterator<Item = (&ZoneConfig, &VnetConfig)> + '_ {
+    pub fn vnets(&self) -> impl Iterator<Item = (&ZoneConfig, &VnetConfig)> {
         self.zones()
             .flat_map(|zone| zone.vnets().map(move |vnet| (zone, vnet)))
     }
@@ -544,7 +544,7 @@ impl SdnConfig {
     pub fn ipsets<'a>(
         &'a self,
         filter: Option<&'a Allowlist<VnetName>>,
-    ) -> impl Iterator<Item = Ipset> + '_ {
+    ) -> impl Iterator<Item = Ipset> {
         self.zones
             .values()
             .flat_map(|zone| zone.vnets())
diff --git a/proxmox-ve-config/src/sdn/ipam.rs b/proxmox-ve-config/src/sdn/ipam.rs
index 598b835..0e6dd69 100644
--- a/proxmox-ve-config/src/sdn/ipam.rs
+++ b/proxmox-ve-config/src/sdn/ipam.rs
@@ -321,7 +321,7 @@ impl Ipam {
     ///
     /// It contains all IPs in all VNets, that a guest has stored in IPAM.
     /// Ipset name is of the form `guest-ipam-<vmid>`
-    pub fn ipsets(&self, filter: Option<&Allowlist<Vmid>>) -> impl Iterator<Item = Ipset> + '_ {
+    pub fn ipsets(&self, filter: Option<&Allowlist<Vmid>>) -> impl Iterator<Item = Ipset> {
         self.entries
             .iter()
             .flat_map(|(_, entries)| entries.iter())
-- 
2.39.5



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


  reply	other threads:[~2025-03-31 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 13:51 [pve-devel] [PATCH 1/4] cargo: set edition to 2024 Maximiliano Sandoval
2025-03-31 13:51 ` Maximiliano Sandoval [this message]
2025-03-31 13:51 ` [pve-devel] [PATCH 3/4] elide serde lifetimes Maximiliano Sandoval
2025-03-31 13:51 ` [pve-devel] [PATCH 4/4] run cargo fmt with edition 2024 Maximiliano Sandoval

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=20250331135131.127561-2-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-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