core: avoid Url parse expect in topology readiness

This commit is contained in:
andrussal 2025-12-18 22:28:37 +01:00
parent 5bcdb6a1c9
commit 4da09bfe85

View File

@ -156,8 +156,10 @@ impl GeneratedTopology {
let client = Client::new(); let client = Client::new();
let make_testing_base_url = |port: u16| -> Url { let make_testing_base_url = |port: u16| -> Url {
Url::parse(&format!("http://127.0.0.1:{port}/")) Url::parse(&format!("http://127.0.0.1:{port}/")).unwrap_or_else(|_| unsafe {
.expect("failed to construct local testing base url") // Safety: `port` is a valid u16 port.
std::hint::unreachable_unchecked()
})
}; };
if endpoints.len() > 1 { if endpoints.len() > 1 {