matrix_sdk: Use our version of the async_trait macro

master
Devin Ragotzy 2020-08-11 09:17:18 -04:00
parent 4770dc636a
commit 9234ac96e1
1 changed files with 7 additions and 3 deletions

View File

@ -15,12 +15,12 @@
use std::{convert::TryFrom, sync::Arc}; use std::{convert::TryFrom, sync::Arc};
use http::{HeaderValue, Method as HttpMethod, Response as HttpResponse}; use http::{HeaderValue, Method as HttpMethod, Response as HttpResponse};
use matrix_sdk_common::{locks::RwLock, FromHttpResponseError};
use matrix_sdk_common_macros::async_trait;
use reqwest::{Client, Response}; use reqwest::{Client, Response};
use tracing::trace; use tracing::trace;
use url::Url; use url::Url;
use matrix_sdk_common::{locks::RwLock, FromHttpResponseError};
use crate::{ClientConfig, Endpoint, Error, HttpSend, Result, Session}; use crate::{ClientConfig, Endpoint, Error, HttpSend, Result, Session};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
@ -141,13 +141,17 @@ impl DefaultHttpClient {
http_client.default_headers(headers) http_client.default_headers(headers)
}; };
#[cfg(target_arch = "wasm32")]
#[allow(unused)]
let _ = config;
Ok(Self { Ok(Self {
inner: http_client.build()?, inner: http_client.build()?,
}) })
} }
} }
#[async_trait::async_trait] #[async_trait]
impl HttpSend for DefaultHttpClient { impl HttpSend for DefaultHttpClient {
async fn send_request(&self, request: http::Request<Vec<u8>>) -> Result<Response> { async fn send_request(&self, request: http::Request<Vec<u8>>) -> Result<Response> {
Ok(self Ok(self