unnest the match, as per review request

This commit is contained in:
Christian Schwarz
2024-01-25 18:28:05 +00:00
parent f79e4a3a0b
commit cf916b9be8

View File

@@ -239,19 +239,9 @@ impl PageServerNode {
let res =
tokio::time::timeout(Duration::from_secs(1), self.http_client.status()).await;
match res {
Ok(res) => match res {
Ok(_) => Ok(true),
Err(e) => match e {
mgmt_api::Error::ReceiveBody(e) => {
if e.is_connect() {
Ok(false)
} else {
anyhow::bail!(e)
}
}
e => anyhow::bail!(e),
},
},
Ok(Ok(_)) => Ok(true),
Ok(Err(mgmt_api::Error::ReceiveBody(e))) if e.is_connect() => Ok(false),
Ok(Err(e)) => anyhow::bail!(e),
Err(_timeout) => Ok(false),
}
},