Skip to content

Commit

Permalink
chore: status variable
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Jul 30, 2023
1 parent 6ba457e commit 0dc84c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/registry/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ fn is_hex_string(string: &str) -> bool {
}

async fn parse_http_response(resp: reqwest::Response) -> RegistryResult<Option<ProjectData>> {
match resp.status() {
let status = resp.status();
match status {
code if code.is_success() => Ok(Some(resp.json().await?)),
StatusCode::FORBIDDEN => Err(RegistryError::Config(INVALID_TOKEN_ERROR)),
StatusCode::NOT_FOUND => Ok(None),
_ => Err(RegistryError::Response(format!(
"status={} body={:?}",
resp.status(),
"status={status} body={:?}",
resp.text().await
))),
}
Expand Down

0 comments on commit 0dc84c4

Please sign in to comment.