fix: replace unwrap/expect in production paths with fallible alternatives
This commit is contained in:
@@ -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)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user