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 d177d18 commit 8be82e9Copy full SHA for 8be82e9
client/src/transport.rs
@@ -23,12 +23,14 @@ impl ReqwestTransport {
23
}
24
25
26
- pub fn with_timeouts(url: Url, timeout: Duration, connect_timeout: Option<Duration>) -> Self {
27
- let mut builder = reqwest::Client::builder().timeout(timeout);
28
-
29
- if let Some(connect_timeout) = connect_timeout {
30
- builder = builder.connect_timeout(connect_timeout);
31
- }
+ pub fn with_timeouts(
+ url: Url,
+ timeout: Option<Duration>,
+ connect_timeout: Option<Duration>,
+ ) -> Self {
+ let builder = reqwest::Client::builder()
32
+ .timeout(timeout.unwrap_or(DEFAULT_TIMEOUT))
33
+ .connect_timeout(connect_timeout.unwrap_or(DEFAULT_TIMEOUT));
34
35
let client = builder.build().expect("Failed to build reqwest client");
36
0 commit comments