diff --git a/Cargo.toml b/Cargo.toml index 0d76e75a..f2487b2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ async-trait = "0.1.30" # Ruma dependencies js_int = "0.1.4" -ruma-api = "0.15.0" +ruma-api = "0.15.1" ruma-client-api = { git = "https://github.com/matrix-org/ruma-client-api/", version = "0.7.0" } ruma-events = { git = "https://github.com/matrix-org/ruma-events", version = "0.18.0" } ruma-identifiers = "0.14.1" diff --git a/src/async_client.rs b/src/async_client.rs index 3fc8a648..0affc9a3 100644 --- a/src/async_client.rs +++ b/src/async_client.rs @@ -754,7 +754,7 @@ impl AsyncClient { } } - async fn send( + async fn send + std::fmt::Debug>( &self, request: Request, ) -> Result<::Incoming> @@ -815,21 +815,20 @@ impl AsyncClient { trace!("Got response: {:?}", response); let status = response.status(); - let mut http_response = HttpResponse::builder().status(status); - let headers = http_response.headers_mut().unwrap(); + let mut http_builder = HttpResponse::builder().status(status); + let headers = http_builder.headers_mut().unwrap(); for (k, v) in response.headers_mut().drain() { if let Some(key) = k { headers.insert(key, v); } } - let body = response.bytes().await?.as_ref().to_owned(); - let http_response = http_response.body(body).unwrap(); - let response = ::Incoming::try_from(http_response) - .map_err(|e| Error::LoginError(format!("{:?}", e)))?; + let http_response = http_builder.body(body).unwrap(); - Ok(response) + Ok(::Incoming::try_from( + http_response, + )?) } /// Send a room message to the homeserver. diff --git a/src/error.rs b/src/error.rs index 4e8c40b4..c217ca13 100644 --- a/src/error.rs +++ b/src/error.rs @@ -50,9 +50,6 @@ pub enum Error { /// An error occurred during a E2EE operation. #[error(transparent)] OlmError(#[from] OlmError), - /// An error occurred during log in. - #[error("can't login {0}.")] - LoginError(String), } impl From> for Error {