Apply suggestions from code review

Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
This commit is contained in:
Eelco Dolstra 2024-02-24 10:12:54 +01:00 committed by GitHub
parent 5f981d2f91
commit b41211dc24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -328,7 +328,7 @@ async fn main_cli() -> Result<()> {
Err(anyhow!( Err(anyhow!(
"Startup notification returned an error: {}\n{}", "Startup notification returned an error: {}\n{}",
response.status(), response.status(),
response.text().await.unwrap_or_else(|_| "".to_owned()) response.text().await.unwrap_or_else(|_| "<no response text>".to_owned())
))?; ))?;
} }
} }
@ -386,7 +386,7 @@ async fn post_build_hook(out_paths: &str) -> Result<()> {
Ok(response) if !response.status().is_success() => Err(anyhow!( Ok(response) if !response.status().is_success() => Err(anyhow!(
"magic-nix-cache server failed to enqueue the push request: {}\n{}", "magic-nix-cache server failed to enqueue the push request: {}\n{}",
response.status(), response.status(),
response.text().await.unwrap_or_else(|_| "".to_owned()), response.text().await.unwrap_or_else(|_| "<no response text>".to_owned()),
))?, ))?,
Ok(response) => response Ok(response) => response
.json::<api::EnqueuePathsResponse>() .json::<api::EnqueuePathsResponse>()