mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-23 07:54:48 +02:00
refactor: prefer inline format args
This commit is contained in:
parent
71a04ad4e2
commit
2dea589c0e
18 changed files with 42 additions and 62 deletions
|
@ -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);
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue