We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e26603 commit 89fdf74Copy full SHA for 89fdf74
src/config.rs
@@ -53,11 +53,11 @@ impl ConfigBuilder {
53
}
54
55
/// Sets the timeout
56
- pub fn timeout(mut self, timeout: u8) -> Result<Self, Error> {
57
- if self.config.socks5.is_some() {
+ pub fn timeout(mut self, timeout: Option<u8>) -> Result<Self, Error> {
+ if timeout.is_some() && self.config.socks5.is_some() {
58
return Err(Error::BothSocksAndTimeout);
59
60
- self.config.timeout = Some(Duration::from_secs(timeout as u64));
+ self.config.timeout = timeout.map(|t| Duration::from_secs(t as u64));
61
Ok(self)
62
63
0 commit comments