diff --git a/Cargo.toml b/Cargo.toml index 6891258ce..8ab1d3abf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,7 +105,6 @@ url = "2.4" bytes = "1.0" serde = "1.0" serde_urlencoded = "0.7.1" -tower = { version = "0.5.2", default-features = false, features = ["timeout", "util"] } tower-service = "0.3" futures-core = { version = "0.3.28", default-features = false } futures-util = { version = "0.3.28", default-features = false } @@ -130,6 +129,7 @@ log = "0.4.17" mime = "0.3.16" percent-encoding = "2.3" tokio = { version = "1.0", default-features = false, features = ["net", "time"] } +tower = { version = "0.5.2", default-features = false, features = ["timeout", "util"] } pin-project-lite = "0.2.11" ipnet = "2.3" diff --git a/src/error.rs b/src/error.rs index 6a9f07e51..fd044814d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -169,6 +169,7 @@ impl Error { /// internal equivalents. /// /// Currently only is used for `tower::timeout::error::Elapsed`. +#[cfg(not(target_arch = "wasm32"))] pub(crate) fn cast_to_internal_error(error: BoxError) -> BoxError { if error.is::() { Box::new(crate::error::TimedOut) as BoxError diff --git a/src/lib.rs b/src/lib.rs index cf3d39d0f..981c075ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -173,7 +173,7 @@ //! //! The Client implementation automatically switches to the WASM one when the target_arch is wasm32, //! the usage is basically the same as the async api. Some of the features are disabled in wasm -//! : [`tls`], [`cookie`], [`blocking`]. +//! : [`tls`], [`cookie`], [`blocking`], as well as various `ClientBuilder` methods such as `timeout()` and `connector_layer()`. //! //! //! ## Optional Features