refactor: prefer inline format args

This commit is contained in:
Lucille L. Blumire 2025-04-17 15:48:56 +01:00
parent 71a04ad4e2
commit 2dea589c0e
No known key found for this signature in database
GPG key ID: D168492023622329
18 changed files with 42 additions and 62 deletions

View file

@ -190,15 +190,12 @@ impl VerifierConfig {
pub fn new(args: VerifierConfigArgs) -> error::Result<Self> {
let policy = if let Some(path) = &args.attestation_policy_file {
let policy_content = fs::read_to_string(path).map_err(|e| {
error::Error::internal(format!("Failed to read attestation policy file: {}", e))
error::Error::internal(format!("Failed to read attestation policy file: {e}"))
})?;
let policy_config: AttestationPolicyConfig = serde_yaml::from_str(&policy_content)
.map_err(|e| {
error::Error::internal(format!(
"Failed to parse attestation policy file: {}",
e
))
error::Error::internal(format!("Failed to parse attestation policy file: {e}"))
})?;
tracing::info!("Loaded attestation policy from file: {:?}", path);

View file

@ -31,13 +31,13 @@ impl fmt::Display for VerifierMode {
end_batch,
} => {
if start_batch == end_batch {
write!(f, "one-shot mode (batch {})", start_batch)
write!(f, "one-shot mode (batch {start_batch})")
} else {
write!(f, "one-shot mode (batches {}-{})", start_batch, end_batch)
write!(f, "one-shot mode (batches {start_batch}-{end_batch})")
}
}
VerifierMode::Continuous { start_batch } => {
write!(f, "continuous mode (starting from batch {})", start_batch)
write!(f, "continuous mode (starting from batch {start_batch})")
}
}
}
@ -89,8 +89,7 @@ impl fmt::Display for VerificationResult {
} => {
write!(
f,
"Partial Success ({} verified, {} failed)",
verified_count, unverified_count
"Partial Success ({verified_count} verified, {unverified_count} failed)"
)
}
VerificationResult::Failure => write!(f, "Failure"),