See https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html.
Signed-off-by: Maximiliano Sandoval <m.sando...@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