diff --git a/common/http-api-client/src/lib.rs b/common/http-api-client/src/lib.rs index 9d94dcf30e..856b2ad0e7 100644 --- a/common/http-api-client/src/lib.rs +++ b/common/http-api-client/src/lib.rs @@ -1152,7 +1152,10 @@ impl ApiClientCore for Client { #[cfg(target_arch = "wasm32")] let response: Result = { - let client = self.reqwest_client.as_ref().unwrap_or(&*SHARED_CLIENT); + let client = self + .reqwest_client + .as_ref() + .unwrap_or_else(|| &*SHARED_CLIENT); Ok( wasmtimer::tokio::timeout(self.request_timeout, client.execute(req)) .await @@ -1162,7 +1165,10 @@ impl ApiClientCore for Client { #[cfg(not(target_arch = "wasm32"))] let response = { - let client = self.reqwest_client.as_ref().unwrap_or(&*SHARED_CLIENT); + let client = self + .reqwest_client + .as_ref() + .unwrap_or_else(|| &*SHARED_CLIENT); client.execute(req).await };