all lists on 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 4/4] run cargo fmt with edition 2024
Date: Mon, 31 Mar 2025 15:51:31 +0200	[thread overview]
Message-ID: <20250331135131.127561-4-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20250331135131.127561-1-m.sandoval@proxmox.com>

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxmox-ve-config/src/firewall/cluster.rs          | 6 ++++--
 proxmox-ve-config/src/firewall/common.rs           | 4 ++--
 proxmox-ve-config/src/firewall/ct_helper.rs        | 2 +-
 proxmox-ve-config/src/firewall/guest.rs            | 4 ++--
 proxmox-ve-config/src/firewall/host.rs             | 2 +-
 proxmox-ve-config/src/firewall/parse.rs            | 2 +-
 proxmox-ve-config/src/firewall/ports.rs            | 2 +-
 proxmox-ve-config/src/firewall/types/address.rs    | 6 ++++--
 proxmox-ve-config/src/firewall/types/alias.rs      | 2 +-
 proxmox-ve-config/src/firewall/types/ipset.rs      | 2 +-
 proxmox-ve-config/src/firewall/types/log.rs        | 2 +-
 proxmox-ve-config/src/firewall/types/port.rs       | 2 +-
 proxmox-ve-config/src/firewall/types/rule.rs       | 4 ++--
 proxmox-ve-config/src/firewall/types/rule_match.rs | 6 +++---
 proxmox-ve-config/src/guest/types.rs               | 2 +-
 proxmox-ve-config/src/guest/vm.rs                  | 2 +-
 proxmox-ve-config/src/sdn/config.rs                | 4 ++--
 proxmox-ve-config/src/sdn/ipam.rs                  | 2 +-
 proxmox-ve-config/tests/sdn/main.rs                | 4 ++--
 19 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/proxmox-ve-config/src/firewall/cluster.rs b/proxmox-ve-config/src/firewall/cluster.rs
index ce3dd53..97dcc15 100644
--- a/proxmox-ve-config/src/firewall/cluster.rs
+++ b/proxmox-ve-config/src/firewall/cluster.rs
@@ -135,6 +135,7 @@ pub struct Options {
 #[cfg(test)]
 mod tests {
     use crate::firewall::types::{
+        Cidr,
         address::IpList,
         alias::{AliasName, AliasScope},
         ipset::{IpsetAddress, IpsetEntry},
@@ -143,7 +144,6 @@ mod tests {
         rule_match::{
             Icmpv6, Icmpv6Code, IpAddrMatch, IpMatch, Ports, Protocol, RuleMatch, Tcp, Udp,
         },
-        Cidr,
     };
 
     use super::*;
@@ -226,7 +226,9 @@ IN BGP(REJECT) -log crit -source 1.2.3.4
             Alias::new(
                 "wide",
                 Cidr::new_v6(
-                    [0xCCCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000],
+                    [
+                        0xCCCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000
+                    ],
                     64
                 )
                 .unwrap(),
diff --git a/proxmox-ve-config/src/firewall/common.rs b/proxmox-ve-config/src/firewall/common.rs
index 3999168..09feb83 100644
--- a/proxmox-ve-config/src/firewall/common.rs
+++ b/proxmox-ve-config/src/firewall/common.rs
@@ -1,10 +1,10 @@
 use std::collections::{BTreeMap, HashMap};
 use std::io;
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use serde::de::IntoDeserializer;
 
-use crate::firewall::parse::{parse_named_section_tail, split_key_value, SomeString};
+use crate::firewall::parse::{SomeString, parse_named_section_tail, split_key_value};
 use crate::firewall::types::ipset::{IpsetName, IpsetScope};
 use crate::firewall::types::rule::{Direction, Kind};
 use crate::firewall::types::{Alias, Group, Ipset, Rule};
diff --git a/proxmox-ve-config/src/firewall/ct_helper.rs b/proxmox-ve-config/src/firewall/ct_helper.rs
index 40e4fee..03e2637 100644
--- a/proxmox-ve-config/src/firewall/ct_helper.rs
+++ b/proxmox-ve-config/src/firewall/ct_helper.rs
@@ -1,4 +1,4 @@
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 use serde::Deserialize;
 use std::collections::HashMap;
 use std::sync::OnceLock;
diff --git a/proxmox-ve-config/src/firewall/guest.rs b/proxmox-ve-config/src/firewall/guest.rs
index 23eaa4e..1114452 100644
--- a/proxmox-ve-config/src/firewall/guest.rs
+++ b/proxmox-ve-config/src/firewall/guest.rs
@@ -4,13 +4,13 @@ use std::io;
 use crate::guest::types::Vmid;
 use crate::guest::vm::NetworkConfig;
 
+use crate::firewall::types::Ipset;
 use crate::firewall::types::alias::{Alias, AliasName};
 use crate::firewall::types::ipset::IpsetScope;
 use crate::firewall::types::log::LogLevel;
 use crate::firewall::types::rule::{Direction, Rule, Verdict};
-use crate::firewall::types::Ipset;
 
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 use serde::Deserialize;
 
 use crate::firewall::parse::serde_option_bool;
diff --git a/proxmox-ve-config/src/firewall/host.rs b/proxmox-ve-config/src/firewall/host.rs
index 394896c..39ac67c 100644
--- a/proxmox-ve-config/src/firewall/host.rs
+++ b/proxmox-ve-config/src/firewall/host.rs
@@ -1,7 +1,7 @@
 use std::io;
 use std::net::IpAddr;
 
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 use serde::Deserialize;
 
 use crate::host::utils::{host_ips, network_interface_cidrs};
diff --git a/proxmox-ve-config/src/firewall/parse.rs b/proxmox-ve-config/src/firewall/parse.rs
index 8cf4757..4d02352 100644
--- a/proxmox-ve-config/src/firewall/parse.rs
+++ b/proxmox-ve-config/src/firewall/parse.rs
@@ -1,6 +1,6 @@
 use std::fmt;
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 
 const NAME_SPECIAL_CHARACTERS: [u8; 2] = [b'-', b'_'];
 
diff --git a/proxmox-ve-config/src/firewall/ports.rs b/proxmox-ve-config/src/firewall/ports.rs
index 9d5d1be..f88a442 100644
--- a/proxmox-ve-config/src/firewall/ports.rs
+++ b/proxmox-ve-config/src/firewall/ports.rs
@@ -1,4 +1,4 @@
-use anyhow::{format_err, Error};
+use anyhow::{Error, format_err};
 use std::sync::OnceLock;
 
 #[derive(Default)]
diff --git a/proxmox-ve-config/src/firewall/types/address.rs b/proxmox-ve-config/src/firewall/types/address.rs
index 9b73d3d..e279111 100644
--- a/proxmox-ve-config/src/firewall/types/address.rs
+++ b/proxmox-ve-config/src/firewall/types/address.rs
@@ -2,7 +2,7 @@ use std::fmt::{self, Display};
 use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
 use std::ops::Deref;
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use serde_with::{DeserializeFromStr, SerializeDisplay};
 
 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
@@ -1652,7 +1652,9 @@ mod tests {
 
         assert_eq!(
             [Ipv6Cidr::new(
-                [0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF],
+                [
+                    0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF
+                ],
                 128
             )
             .unwrap(),],
diff --git a/proxmox-ve-config/src/firewall/types/alias.rs b/proxmox-ve-config/src/firewall/types/alias.rs
index 7bc2fb8..22534d5 100644
--- a/proxmox-ve-config/src/firewall/types/alias.rs
+++ b/proxmox-ve-config/src/firewall/types/alias.rs
@@ -1,7 +1,7 @@
 use std::fmt::Display;
 use std::str::FromStr;
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use serde_with::{DeserializeFromStr, SerializeDisplay};
 
 use crate::firewall::parse::{match_name, match_non_whitespace};
diff --git a/proxmox-ve-config/src/firewall/types/ipset.rs b/proxmox-ve-config/src/firewall/types/ipset.rs
index fe5a930..231014e 100644
--- a/proxmox-ve-config/src/firewall/types/ipset.rs
+++ b/proxmox-ve-config/src/firewall/types/ipset.rs
@@ -2,7 +2,7 @@ use core::fmt::Display;
 use std::ops::{Deref, DerefMut};
 use std::str::FromStr;
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use serde_with::DeserializeFromStr;
 
 use crate::firewall::parse::match_non_whitespace;
diff --git a/proxmox-ve-config/src/firewall/types/log.rs b/proxmox-ve-config/src/firewall/types/log.rs
index 72344e4..14bffe9 100644
--- a/proxmox-ve-config/src/firewall/types/log.rs
+++ b/proxmox-ve-config/src/firewall/types/log.rs
@@ -2,7 +2,7 @@ use std::fmt;
 use std::str::FromStr;
 
 use crate::firewall::parse::parse_bool;
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 use serde::{Deserialize, Serialize};
 
 #[derive(Copy, Clone, Debug, Deserialize, Serialize, Default)]
diff --git a/proxmox-ve-config/src/firewall/types/port.rs b/proxmox-ve-config/src/firewall/types/port.rs
index c1252d9..999f10a 100644
--- a/proxmox-ve-config/src/firewall/types/port.rs
+++ b/proxmox-ve-config/src/firewall/types/port.rs
@@ -1,7 +1,7 @@
 use std::fmt;
 use std::ops::Deref;
 
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 use serde_with::DeserializeFromStr;
 
 use crate::firewall::ports::parse_named_port;
diff --git a/proxmox-ve-config/src/firewall/types/rule.rs b/proxmox-ve-config/src/firewall/types/rule.rs
index 2c8f49c..fc4be03 100644
--- a/proxmox-ve-config/src/firewall/types/rule.rs
+++ b/proxmox-ve-config/src/firewall/types/rule.rs
@@ -2,7 +2,7 @@ use core::fmt::Display;
 use std::fmt;
 use std::str::FromStr;
 
-use anyhow::{bail, ensure, format_err, Error};
+use anyhow::{Error, bail, ensure, format_err};
 
 use crate::firewall::parse::match_name;
 use crate::firewall::types::rule_match::RuleMatch;
@@ -248,12 +248,12 @@ impl FromStr for RuleGroup {
 #[cfg(test)]
 mod tests {
     use crate::firewall::types::{
+        Cidr,
         address::{IpEntry, IpList, IpRange},
         alias::{AliasName, AliasScope},
         ipset::{IpsetName, IpsetScope},
         log::LogLevel,
         rule_match::{Icmp, IcmpCode, IpAddrMatch, IpMatch, Ports, Protocol, Udp},
-        Cidr,
     };
 
     use super::*;
diff --git a/proxmox-ve-config/src/firewall/types/rule_match.rs b/proxmox-ve-config/src/firewall/types/rule_match.rs
index 94d8624..5ab31ca 100644
--- a/proxmox-ve-config/src/firewall/types/rule_match.rs
+++ b/proxmox-ve-config/src/firewall/types/rule_match.rs
@@ -4,12 +4,12 @@ use std::str::FromStr;
 
 use serde::Deserialize;
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 use serde::de::IntoDeserializer;
 
 use proxmox_sortable_macro::sortable;
 
-use crate::firewall::parse::{match_name, match_non_whitespace, SomeStr};
+use crate::firewall::parse::{SomeStr, match_name, match_non_whitespace};
 use crate::firewall::types::address::{Family, IpList};
 use crate::firewall::types::alias::AliasName;
 use crate::firewall::types::ipset::IpsetName;
@@ -770,7 +770,7 @@ impl fmt::Display for Icmpv6Code {
 
 #[cfg(test)]
 mod tests {
-    use crate::firewall::types::{alias::AliasScope::Guest, Cidr};
+    use crate::firewall::types::{Cidr, alias::AliasScope::Guest};
 
     use super::*;
 
diff --git a/proxmox-ve-config/src/guest/types.rs b/proxmox-ve-config/src/guest/types.rs
index ed6a48c..3068878 100644
--- a/proxmox-ve-config/src/guest/types.rs
+++ b/proxmox-ve-config/src/guest/types.rs
@@ -1,7 +1,7 @@
 use std::fmt;
 use std::str::FromStr;
 
-use anyhow::{format_err, Error};
+use anyhow::{Error, format_err};
 use serde_with::{DeserializeFromStr, SerializeDisplay};
 
 #[derive(
diff --git a/proxmox-ve-config/src/guest/vm.rs b/proxmox-ve-config/src/guest/vm.rs
index 3476b93..1644516 100644
--- a/proxmox-ve-config/src/guest/vm.rs
+++ b/proxmox-ve-config/src/guest/vm.rs
@@ -5,7 +5,7 @@ use std::{collections::HashMap, net::Ipv6Addr};
 
 use proxmox_schema::property_string::PropertyIterator;
 
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 use serde_with::DeserializeFromStr;
 
 use crate::firewall::parse::{match_digits, parse_bool};
diff --git a/proxmox-ve-config/src/sdn/config.rs b/proxmox-ve-config/src/sdn/config.rs
index dc90f0f..800f8fa 100644
--- a/proxmox-ve-config/src/sdn/config.rs
+++ b/proxmox-ve-config/src/sdn/config.rs
@@ -6,7 +6,7 @@ use std::{
     str::FromStr,
 };
 
-use proxmox_schema::{property_string::PropertyString, ApiType, ObjectSchema, StringSchema};
+use proxmox_schema::{ApiType, ObjectSchema, StringSchema, property_string::PropertyString};
 
 use serde::Deserialize;
 use serde_with::{DeserializeFromStr, SerializeDisplay};
@@ -14,9 +14,9 @@ use serde_with::{DeserializeFromStr, SerializeDisplay};
 use crate::{
     common::Allowlist,
     firewall::types::{
+        Cidr, Ipset,
         address::{IpRange, IpRangeError},
         ipset::{IpsetEntry, IpsetName, IpsetScope},
-        Cidr, Ipset,
     },
     sdn::{SdnNameError, SubnetName, VnetName, ZoneName},
 };
diff --git a/proxmox-ve-config/src/sdn/ipam.rs b/proxmox-ve-config/src/sdn/ipam.rs
index 0e6dd69..6fea5a4 100644
--- a/proxmox-ve-config/src/sdn/ipam.rs
+++ b/proxmox-ve-config/src/sdn/ipam.rs
@@ -10,8 +10,8 @@ use serde::Deserialize;
 use crate::{
     common::Allowlist,
     firewall::types::{
-        ipset::{IpsetEntry, IpsetScope},
         Cidr, Ipset,
+        ipset::{IpsetEntry, IpsetScope},
     },
     guest::{types::Vmid, vm::MacAddress},
     sdn::{SdnNameError, SubnetName, ZoneName},
diff --git a/proxmox-ve-config/tests/sdn/main.rs b/proxmox-ve-config/tests/sdn/main.rs
index 1815bec..32b5454 100644
--- a/proxmox-ve-config/tests/sdn/main.rs
+++ b/proxmox-ve-config/tests/sdn/main.rs
@@ -4,15 +4,15 @@ use std::{
 };
 
 use proxmox_ve_config::{
-    firewall::types::{address::IpRange, Cidr},
+    firewall::types::{Cidr, address::IpRange},
     guest::vm::MacAddress,
     sdn::{
+        SubnetName, VnetName, ZoneName,
         config::{
             RunningConfig, SdnConfig, SdnConfigError, SubnetConfig, VnetConfig, ZoneConfig,
             ZoneType,
         },
         ipam::{Ipam, IpamDataVm, IpamEntry, IpamJson},
-        SubnetName, VnetName, ZoneName,
     },
 };
 
-- 
2.39.5



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


      parent reply	other threads:[~2025-03-31 13:52 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 ` [pve-devel] [PATCH 2/4] stop using captures trick Maximiliano Sandoval
2025-03-31 13:51 ` [pve-devel] [PATCH 3/4] elide serde lifetimes Maximiliano Sandoval
2025-03-31 13:51 ` Maximiliano Sandoval [this message]

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-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal