From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 04/10] cargo: run fmt
Date: Mon, 26 Jan 2026 16:13:41 +0100 [thread overview]
Message-ID: <20260126151349.627829-5-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20260126151349.627829-1-m.sandoval@proxmox.com>
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 <m.sandoval@proxmox.com>
---
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<Self, Self::Err> {
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 '<group:GROUP||type:<vm|ct|host>|regex:REGEX>'"),
+ None => bail!(
+ "input doesn't match expected format '<group:GROUP||type:<vm|ct|host>|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<S>(stream: S) -> Body
where
S: futures::stream::TryStream + Send + 'static,
-
S::Error: Into<Error>,
-
Bytes: From<S::Ok>,
{
Body::stream(stream)
@@ -57,9 +55,7 @@ impl Body {
pub(crate) fn stream<S>(stream: S) -> Body
where
S: futures::stream::TryStream + Send + 'static,
-
S::Error: Into<Error>,
-
Bytes: From<S::Ok>,
{
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<R: Read + Seek, P: AsRef<Path>>(
| 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<Option<SubscriptionInfo>, 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
next prev parent reply other threads:[~2026-01-26 15:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 15:13 [pbs-devel] [PATCH proxmox 00/10] Bump edition to 2024 Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 01/10] adapt to rust 2024 match ergonomics Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 02/10] rustfmt: Set style_edition to 2021 Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 03/10] cargo: set workspace edition to 2024 Maximiliano Sandoval
2026-01-26 15:13 ` Maximiliano Sandoval [this message]
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 05/10] cargo: set resolver to 3 Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 06/10] cargo: run --fix Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 07/10] cargo: run fmt again Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 08/10] Remove rustfmt.toml and run cargo fmt Maximiliano Sandoval
2026-01-26 15:13 ` [pbs-devel] [PATCH proxmox 10/10] pve-api-types: specify rustfmt --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=20260126151349.627829-5-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pbs-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.