From 395991b4f489dca835a374bff2330bb15a5048f4 Mon Sep 17 00:00:00 2001 From: Rahamath-Unnisa Date: Sat, 11 Oct 2025 13:01:07 +0000 Subject: [PATCH] Refactor timeout builder to accept Option --- src/client.rs | 2 +- src/config.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index 1ed336b..e4f15db 100644 --- a/src/client.rs +++ b/src/client.rs @@ -442,7 +442,7 @@ mod tests { }); receiver - .recv_timeout(Duration::from_secs(5)) + .recv_timeout(some(Duration::from_secs(5))) .expect("Can't start local listener"); let now = Instant::now(); diff --git a/src/config.rs b/src/config.rs index 47da1f9..e4c5770 100644 --- a/src/config.rs +++ b/src/config.rs @@ -55,8 +55,8 @@ impl ConfigBuilder { } /// Sets the timeout - pub fn timeout(mut self, timeout: Option) -> Self { - self.config.timeout = timeout.map(|t| Duration::from_secs(t as u64)); + pub fn timeout(mut self, timeout: Option) -> Self { + self.config.timeout = timeout; self }