From 9c98d0227b4b1d08293e8d0b091171b45a6af114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 22 Jan 2021 18:12:46 +0100 Subject: [PATCH] matrix-sdk: Make the http client trait WASM compatible --- matrix_sdk/src/http_client.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/matrix_sdk/src/http_client.rs b/matrix_sdk/src/http_client.rs index 0f5adf92..fd84a424 100644 --- a/matrix_sdk/src/http_client.rs +++ b/matrix_sdk/src/http_client.rs @@ -20,15 +20,17 @@ use tracing::trace; use url::Url; use matrix_sdk_common::{ - api::r0::media::create_content, async_trait, locks::RwLock, AuthScheme, FromHttpResponseError, + api::r0::media::create_content, async_trait, locks::RwLock, AsyncTraitDeps, AuthScheme, + FromHttpResponseError, }; use crate::{ClientConfig, Error, OutgoingRequest, Result, Session}; /// Abstraction around the http layer. The allows implementors to use different /// http libraries. -#[async_trait] -pub trait HttpSend: Sync + Send + Debug { +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +pub trait HttpSend: AsyncTraitDeps { /// The method abstracting sending request types and receiving response types. /// /// This is called by the client every time it wants to send anything to a homeserver. @@ -203,7 +205,8 @@ async fn response_to_http_response(mut response: Response) -> Result