Skip to content

Commit 1ef8703

Browse files
authored
(wasm) fix: remove tower as dependency for wasm32-unknown-unknown (#2510)
1 parent 224f0b8 commit 1ef8703

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ url = "2.4"
105105
bytes = "1.0"
106106
serde = "1.0"
107107
serde_urlencoded = "0.7.1"
108-
tower = { version = "0.5.2", default-features = false, features = ["timeout", "util"] }
109108
tower-service = "0.3"
110109
futures-core = { version = "0.3.28", default-features = false }
111110
futures-util = { version = "0.3.28", default-features = false }
@@ -130,6 +129,7 @@ log = "0.4.17"
130129
mime = "0.3.16"
131130
percent-encoding = "2.3"
132131
tokio = { version = "1.0", default-features = false, features = ["net", "time"] }
132+
tower = { version = "0.5.2", default-features = false, features = ["timeout", "util"] }
133133
pin-project-lite = "0.2.11"
134134
ipnet = "2.3"
135135

src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ impl Error {
169169
/// internal equivalents.
170170
///
171171
/// Currently only is used for `tower::timeout::error::Elapsed`.
172+
#[cfg(not(target_arch = "wasm32"))]
172173
pub(crate) fn cast_to_internal_error(error: BoxError) -> BoxError {
173174
if error.is::<tower::timeout::error::Elapsed>() {
174175
Box::new(crate::error::TimedOut) as BoxError

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
//!
174174
//! The Client implementation automatically switches to the WASM one when the target_arch is wasm32,
175175
//! the usage is basically the same as the async api. Some of the features are disabled in wasm
176-
//! : [`tls`], [`cookie`], [`blocking`].
176+
//! : [`tls`], [`cookie`], [`blocking`], as well as various `ClientBuilder` methods such as `timeout()` and `connector_layer()`.
177177
//!
178178
//!
179179
//! ## Optional Features

0 commit comments

Comments
 (0)