From 0dc84c4d371512c4d7f27b3a1e6dec64ae8305d5 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 30 Jul 2023 08:10:37 -0400 Subject: [PATCH] chore: status variable --- src/registry/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/registry/client.rs b/src/registry/client.rs index 3b564e4..706f031 100644 --- a/src/registry/client.rs +++ b/src/registry/client.rs @@ -116,13 +116,13 @@ fn is_hex_string(string: &str) -> bool { } async fn parse_http_response(resp: reqwest::Response) -> RegistryResult> { - 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 ))), }