mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 07:03:56 +02:00
refactor: combine equivalent match branches
This commit is contained in:
parent
36afc85d38
commit
6a9e035d19
4 changed files with 10 additions and 9 deletions
|
@ -72,9 +72,9 @@ impl VerificationResult {
|
|||
verified_count,
|
||||
unverified_count,
|
||||
} => verified_count > unverified_count,
|
||||
VerificationResult::Failure => false,
|
||||
VerificationResult::Interrupted => false,
|
||||
VerificationResult::NoProofsFound => false,
|
||||
VerificationResult::Failure
|
||||
| VerificationResult::Interrupted
|
||||
| VerificationResult::NoProofsFound => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,8 +50,9 @@ impl ContinuousProcessor {
|
|||
match self.batch_processor.process_batch(token, batch).await {
|
||||
Ok(result) => {
|
||||
match result {
|
||||
VerificationResult::Success => success_count += 1,
|
||||
VerificationResult::PartialSuccess { .. } => success_count += 1,
|
||||
VerificationResult::Success | VerificationResult::PartialSuccess { .. } => {
|
||||
success_count += 1;
|
||||
}
|
||||
VerificationResult::Failure => failure_count += 1,
|
||||
VerificationResult::Interrupted => {
|
||||
results.push((current_batch, result));
|
||||
|
|
|
@ -55,8 +55,9 @@ impl OneShotProcessor {
|
|||
let result = self.batch_processor.process_batch(token, batch).await?;
|
||||
|
||||
match result {
|
||||
VerificationResult::Success => success_count += 1,
|
||||
VerificationResult::PartialSuccess { .. } => success_count += 1,
|
||||
VerificationResult::Success | VerificationResult::PartialSuccess { .. } => {
|
||||
success_count += 1;
|
||||
}
|
||||
VerificationResult::Failure => failure_count += 1,
|
||||
VerificationResult::Interrupted => {
|
||||
results.push((batch_number, result));
|
||||
|
|
|
@ -38,8 +38,7 @@ impl FromStr for TcbLevel {
|
|||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s.to_ascii_lowercase().as_str() {
|
||||
"ok" => Ok(TcbLevel::Ok),
|
||||
"uptodate" => Ok(TcbLevel::Ok),
|
||||
"ok" | "uptodate" => Ok(TcbLevel::Ok),
|
||||
"configneeded" => Ok(TcbLevel::ConfigNeeded),
|
||||
"configandswhardeningneeded" => Ok(TcbLevel::ConfigAndSwHardeningNeeded),
|
||||
"swhardeningneeded" => Ok(TcbLevel::SwHardeningNeeded),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue