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

@@ -203,7 +203,7 @@ async fn main() -> anyhow::Result<()> {
transport.max_idle_timeout(Some(
std::time::Duration::from_secs(300)
.try_into()
.expect("300s is a valid IdleTimeout"),
.map_err(|e| anyhow::anyhow!("idle timeout: {e}"))?,
));
transport.max_concurrent_bidi_streams(1u32.into());
transport.max_concurrent_uni_streams(0u32.into());
@@ -390,7 +390,7 @@ async fn main() -> anyhow::Result<()> {
transport.max_idle_timeout(Some(
std::time::Duration::from_secs(120)
.try_into()
.expect("120s is valid"),
.map_err(|e| anyhow::anyhow!("idle timeout: {e}"))?,
));
qc.transport_config(Arc::new(transport));
Some(qc)