fix: replace unwrap/expect in production paths with fallible alternatives

This commit is contained in:
2026-03-04 13:29:33 +01:00
parent cab03bd3f7
commit a8ed3c4356
5 changed files with 35 additions and 5 deletions

View File

@@ -40,7 +40,11 @@ impl RpcClient {
let quic_tls = quinn::crypto::rustls::QuicClientConfig::try_from(tls)
.map_err(|e| RpcError::Connection(format!("TLS config: {e}")))?;
let mut endpoint = Endpoint::client("0.0.0.0:0".parse().expect("valid addr"))
let bind_addr = std::net::SocketAddr::new(
std::net::IpAddr::V4(std::net::Ipv4Addr::UNSPECIFIED),
0,
);
let mut endpoint = Endpoint::client(bind_addr)
.map_err(|e| RpcError::Connection(e.to_string()))?;
endpoint.set_default_client_config(quinn::ClientConfig::new(Arc::new(quic_tls)));