Skip to content

Commit

Permalink
chore: if -> match
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Jun 25, 2024
1 parent 8e87e0a commit a8a2c55
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/attestation_store/cf_kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,16 @@ impl AttestationStore for CloudflareKv {
.timeout(Duration::from_secs(1))
.send()
.await?;
if response.status().is_success() {
let value = response.text().await?;
Ok(Some(value))
} else if response.status() == StatusCode::NOT_FOUND {
Ok(None)
} else {
Err(anyhow::anyhow!(
"Failed to get attestation: status:{} response body:{:?}",
response.status(),
match response.status() {
status if status.is_success() => {
let value = response.text().await?;
Ok(Some(value))
}
StatusCode::NOT_FOUND => Ok(None),
status => Err(anyhow::anyhow!(
"Failed to get attestation: status:{status} response body:{:?}",
response.text().await
))
)),
}
}
}

0 comments on commit a8a2c55

Please sign in to comment.