From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1C65F1FF16E for <inbox@lore.proxmox.com>; Mon, 31 Mar 2025 15:52:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4F0D474B5; Mon, 31 Mar 2025 15:52:07 +0200 (CEST) From: Maximiliano Sandoval <m.sandoval@proxmox.com> To: pve-devel@lists.proxmox.com Date: Mon, 31 Mar 2025 15:51:31 +0200 Message-Id: <20250331135131.127561-4-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250331135131.127561-1-m.sandoval@proxmox.com> References: <20250331135131.127561-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_CSS_A 0.1 Contains URL's A record listed in the Spamhaus CSS blocklist [195.154.200.217] Subject: [pve-devel] [PATCH 4/4] run cargo fmt with edition 2024 X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.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