From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7CF2B1FF136 for ; Mon, 26 Jan 2026 16:13:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 26AA111293; Mon, 26 Jan 2026 16:13:56 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Mon, 26 Jan 2026 16:13:41 +0100 Message-ID: <20260126151349.627829-5-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260126151349.627829-1-m.sandoval@proxmox.com> References: <20260126151349.627829-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769440366594 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.088 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 Subject: [pbs-devel] [PATCH proxmox 04/10] cargo: run fmt X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" To reflect changes in rust 2024, see https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-formatting-fixes.html. Signed-off-by: Maximiliano Sandoval --- pbs-api-types/src/jobs.rs | 8 ++++++-- proxmox-api-macro/src/api/method.rs | 2 +- proxmox-auth-api/src/auth_key.rs | 6 +++--- proxmox-http/src/body.rs | 4 ---- proxmox-network-api/src/api_impl.rs | 4 +++- proxmox-oci/src/lib.rs | 2 +- proxmox-rest-server/src/connection.rs | 6 ++++-- proxmox-schema/src/de/mod.rs | 2 +- proxmox-schema/src/schema.rs | 4 +++- proxmox-subscription/src/files.rs | 2 +- proxmox-tfa/src/api/mod.rs | 4 ++-- proxmox-tfa/src/totp.rs | 6 ++++-- proxmox-upgrade-checks/src/lib.rs | 2 +- 13 files changed, 30 insertions(+), 22 deletions(-) diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 7e6dfb94..b188cdc6 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -463,11 +463,15 @@ impl std::str::FromStr for FilterType { fn from_str(s: &str) -> Result { Ok(match s.split_once(':') { - Some(("group", value)) => BACKUP_GROUP_SCHEMA.parse_simple_value(value).map(|_| FilterType::Group(value.to_string()))?, + Some(("group", value)) => BACKUP_GROUP_SCHEMA + .parse_simple_value(value) + .map(|_| FilterType::Group(value.to_string()))?, Some(("type", value)) => FilterType::BackupType(value.parse()?), Some(("regex", value)) => FilterType::Regex(Regex::new(value)?), Some((ty, _value)) => bail!("expected 'group', 'type' or 'regex' prefix, got '{}'", ty), - None => bail!("input doesn't match expected format '|regex:REGEX>'"), + None => bail!( + "input doesn't match expected format '|regex:REGEX>'" + ), }) } } diff --git a/proxmox-api-macro/src/api/method.rs b/proxmox-api-macro/src/api/method.rs index 0fe2cf42..ab0801aa 100644 --- a/proxmox-api-macro/src/api/method.rs +++ b/proxmox-api-macro/src/api/method.rs @@ -530,7 +530,7 @@ fn is_value_type(ty: &syn::Type) -> bool { 1 => return segs.last().unwrap().ident == "Value", 2 => { return segs.first().unwrap().ident == "serde_json" - && segs.last().unwrap().ident == "Value" + && segs.last().unwrap().ident == "Value"; } _ => return false, } diff --git a/proxmox-auth-api/src/auth_key.rs b/proxmox-auth-api/src/auth_key.rs index 2ccc1110..667deaaf 100644 --- a/proxmox-auth-api/src/auth_key.rs +++ b/proxmox-auth-api/src/auth_key.rs @@ -320,7 +320,7 @@ impl Keyring { if let Some(key) = &self.signing_key { match key { SigningKey::Private(key) if verify_with(&key.key, digest, signature, data)? => { - return Ok(true) + return Ok(true); } SigningKey::Hmac(key) if key.verify(digest, signature, data)? => return Ok(true), _ => (), @@ -330,10 +330,10 @@ impl Keyring { for key in &self.public_keys { match key { VerificationKey::Public(key) if verify_with(&key.key, digest, signature, data)? => { - return Ok(true) + return Ok(true); } VerificationKey::Hmac(key) if key.verify(digest, signature, data)? => { - return Ok(true) + return Ok(true); } _ => (), } diff --git a/proxmox-http/src/body.rs b/proxmox-http/src/body.rs index 18075099..4547ac57 100644 --- a/proxmox-http/src/body.rs +++ b/proxmox-http/src/body.rs @@ -46,9 +46,7 @@ impl Body { pub fn wrap_stream(stream: S) -> Body where S: futures::stream::TryStream + Send + 'static, - S::Error: Into, - Bytes: From, { Body::stream(stream) @@ -57,9 +55,7 @@ impl Body { pub(crate) fn stream(stream: S) -> Body where S: futures::stream::TryStream + Send + 'static, - S::Error: Into, - Bytes: From, { use futures::TryStreamExt; diff --git a/proxmox-network-api/src/api_impl.rs b/proxmox-network-api/src/api_impl.rs index 18602900..50dc46af 100644 --- a/proxmox-network-api/src/api_impl.rs +++ b/proxmox-network-api/src/api_impl.rs @@ -99,7 +99,9 @@ pub fn create_interface(iface: String, config: InterfaceUpdater) -> Result<(), E } if config.bond_xmit_hash_policy.is_some() { if mode != LinuxBondMode::Ieee802_3ad && mode != LinuxBondMode::BalanceXor { - bail!("bond_xmit_hash_policy is only valid with LACP(802.3ad) or balance-xor mode"); + bail!( + "bond_xmit_hash_policy is only valid with LACP(802.3ad) or balance-xor mode" + ); } interface.bond_xmit_hash_policy = config.bond_xmit_hash_policy; } diff --git a/proxmox-oci/src/lib.rs b/proxmox-oci/src/lib.rs index cce68207..3b92d849 100644 --- a/proxmox-oci/src/lib.rs +++ b/proxmox-oci/src/lib.rs @@ -217,7 +217,7 @@ fn extract_image_rootfs>( | MediaType::ArtifactManifest | MediaType::EmptyJSON | MediaType::Other(_)) => { - return Err(ExtractError::WrongMediaType(media_type.to_string())) + return Err(ExtractError::WrongMediaType(media_type.to_string())); } }; diff --git a/proxmox-rest-server/src/connection.rs b/proxmox-rest-server/src/connection.rs index 3ac1967c..1faa3828 100644 --- a/proxmox-rest-server/src/connection.rs +++ b/proxmox-rest-server/src/connection.rs @@ -362,7 +362,7 @@ impl AcceptBuilder { let (socket, peer) = match listener.accept().await { Ok(connection) => connection, Err(error) => { - return Err(format_err!(error)).context("error while accepting tcp stream") + return Err(format_err!(error)).context("error while accepting tcp stream"); } }; @@ -468,7 +468,9 @@ impl AcceptBuilder { let insecure_stream = Box::pin(state.socket); if let Err(send_err) = insecure_sender.send(Ok(insecure_stream)).await { - log::error!("[{peer}] failed to accept connection - connection channel closed: {send_err}"); + log::error!( + "[{peer}] failed to accept connection - connection channel closed: {send_err}" + ); } } Err(err) => { diff --git a/proxmox-schema/src/de/mod.rs b/proxmox-schema/src/de/mod.rs index ca6b4981..ea5661d8 100644 --- a/proxmox-schema/src/de/mod.rs +++ b/proxmox-schema/src/de/mod.rs @@ -638,7 +638,7 @@ impl<'de> de::MapAccess<'de> for MapAccess<'de, '_> { None => { return Err(Error::msg( "value without key, but schema does not define a default key", - )) + )); } }, }; diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs index 8413d40b..ddd11761 100644 --- a/proxmox-schema/src/schema.rs +++ b/proxmox-schema/src/schema.rs @@ -1454,7 +1454,9 @@ impl Schema { if let Some(key) = default_key { param_list.push((key.to_string(), value.into_owned())); } else { - bail!("Value '{value}' without key, but schema does not define a default key."); + bail!( + "Value '{value}' without key, but schema does not define a default key." + ); } } } diff --git a/proxmox-subscription/src/files.rs b/proxmox-subscription/src/files.rs index 1644e90a..a450e131 100644 --- a/proxmox-subscription/src/files.rs +++ b/proxmox-subscription/src/files.rs @@ -67,7 +67,7 @@ fn parse_subscription_file(raw: &str) -> Result, Error> status: SubscriptionStatus::Invalid, message: Some("subscription key mismatch".to_string()), ..info - })) + })); } _ => {} } diff --git a/proxmox-tfa/src/api/mod.rs b/proxmox-tfa/src/api/mod.rs index 321658e9..5d1386fa 100644 --- a/proxmox-tfa/src/api/mod.rs +++ b/proxmox-tfa/src/api/mod.rs @@ -1228,11 +1228,11 @@ impl<'de> Deserialize<'de> for TotpEntry { "totp" if totp.is_some() => return Err(A::Error::duplicate_field("totp")), "totp" => totp = Some(map.next_value()?), "last-count" if last_count.is_some() => { - return Err(A::Error::duplicate_field("last-count")) + return Err(A::Error::duplicate_field("last-count")); } "last-count" => last_count = Some(map.next_value()?), other => { - return Err(A::Error::unknown_field(other, &["totp", "last-count"])) + return Err(A::Error::unknown_field(other, &["totp", "last-count"])); } } } diff --git a/proxmox-tfa/src/totp.rs b/proxmox-tfa/src/totp.rs index 4035dca3..aac584d0 100644 --- a/proxmox-tfa/src/totp.rs +++ b/proxmox-tfa/src/totp.rs @@ -352,7 +352,7 @@ impl Totp { None => { return Err(Error::msg( "cannot create otpauth uri without an account name", - )) + )); } }; @@ -647,7 +647,9 @@ fn test_algorithm_parsing() { let period = 30; let digits = 6; let issuer = "ISSUER"; - let uri = format!("otpauth://totp/user%40hostname?secret={secret}&issuer={issuer}&algorithm=sha1&digits={digits}&period={period}"); + let uri = format!( + "otpauth://totp/user%40hostname?secret={secret}&issuer={issuer}&algorithm=sha1&digits={digits}&period={period}" + ); let hotp: Totp = uri.parse().expect("failed to parse otp uri"); assert_eq!(hotp.algorithm, Algorithm::Sha1); diff --git a/proxmox-upgrade-checks/src/lib.rs b/proxmox-upgrade-checks/src/lib.rs index cfd85ff2..93080bb7 100644 --- a/proxmox-upgrade-checks/src/lib.rs +++ b/proxmox-upgrade-checks/src/lib.rs @@ -603,7 +603,7 @@ impl UpgradeChecker { \n While not necessary for the upgrade it's recommended to use one of:\ \n * chrony (Default in new Proxmox product installations)\ \n * ntpsec\ - \n * openntpd" + \n * openntpd", )?; } else if self.get_systemd_unit_state("ntp.service")?.1 == SystemdUnitState::Active { self.output.log_info( -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel