mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 15:13: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,
|
verified_count,
|
||||||
unverified_count,
|
unverified_count,
|
||||||
} => verified_count > unverified_count,
|
} => verified_count > unverified_count,
|
||||||
VerificationResult::Failure => false,
|
VerificationResult::Failure
|
||||||
VerificationResult::Interrupted => false,
|
| VerificationResult::Interrupted
|
||||||
VerificationResult::NoProofsFound => false,
|
| VerificationResult::NoProofsFound => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,9 @@ impl ContinuousProcessor {
|
||||||
match self.batch_processor.process_batch(token, batch).await {
|
match self.batch_processor.process_batch(token, batch).await {
|
||||||
Ok(result) => {
|
Ok(result) => {
|
||||||
match result {
|
match result {
|
||||||
VerificationResult::Success => success_count += 1,
|
VerificationResult::Success | VerificationResult::PartialSuccess { .. } => {
|
||||||
VerificationResult::PartialSuccess { .. } => success_count += 1,
|
success_count += 1;
|
||||||
|
}
|
||||||
VerificationResult::Failure => failure_count += 1,
|
VerificationResult::Failure => failure_count += 1,
|
||||||
VerificationResult::Interrupted => {
|
VerificationResult::Interrupted => {
|
||||||
results.push((current_batch, result));
|
results.push((current_batch, result));
|
||||||
|
|
|
@ -55,8 +55,9 @@ impl OneShotProcessor {
|
||||||
let result = self.batch_processor.process_batch(token, batch).await?;
|
let result = self.batch_processor.process_batch(token, batch).await?;
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
VerificationResult::Success => success_count += 1,
|
VerificationResult::Success | VerificationResult::PartialSuccess { .. } => {
|
||||||
VerificationResult::PartialSuccess { .. } => success_count += 1,
|
success_count += 1;
|
||||||
|
}
|
||||||
VerificationResult::Failure => failure_count += 1,
|
VerificationResult::Failure => failure_count += 1,
|
||||||
VerificationResult::Interrupted => {
|
VerificationResult::Interrupted => {
|
||||||
results.push((batch_number, result));
|
results.push((batch_number, result));
|
||||||
|
|
|
@ -38,8 +38,7 @@ impl FromStr for TcbLevel {
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
match s.to_ascii_lowercase().as_str() {
|
match s.to_ascii_lowercase().as_str() {
|
||||||
"ok" => Ok(TcbLevel::Ok),
|
"ok" | "uptodate" => Ok(TcbLevel::Ok),
|
||||||
"uptodate" => Ok(TcbLevel::Ok),
|
|
||||||
"configneeded" => Ok(TcbLevel::ConfigNeeded),
|
"configneeded" => Ok(TcbLevel::ConfigNeeded),
|
||||||
"configandswhardeningneeded" => Ok(TcbLevel::ConfigAndSwHardeningNeeded),
|
"configandswhardeningneeded" => Ok(TcbLevel::ConfigAndSwHardeningNeeded),
|
||||||
"swhardeningneeded" => Ok(TcbLevel::SwHardeningNeeded),
|
"swhardeningneeded" => Ok(TcbLevel::SwHardeningNeeded),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue