mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 23:44:53 -04:00
sdk: prefer direct use of IntoHttp ctor instead of implicit #[from] conversions
This commit is contained in:
@@ -96,7 +96,7 @@ fn response_to_error(status: StatusCode, body: Vec<u8>) -> HttpError {
|
||||
|
||||
error.into()
|
||||
}
|
||||
Err(e) => e.into(),
|
||||
Err(e) => HttpError::IntoHttp(e),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ pub enum HttpError {
|
||||
|
||||
/// An error converting between ruma_client_api types and Hyper types.
|
||||
#[error(transparent)]
|
||||
IntoHttp(#[from] IntoHttpError),
|
||||
IntoHttp(IntoHttpError),
|
||||
|
||||
/// An error occurred while refreshing the access token.
|
||||
#[error(transparent)]
|
||||
|
||||
@@ -150,8 +150,9 @@ impl HttpClient {
|
||||
}
|
||||
}
|
||||
|
||||
let request =
|
||||
self.serialize_request(request, config, homeserver, access_token, server_versions)?;
|
||||
let request = self
|
||||
.serialize_request(request, config, homeserver, access_token, server_versions)
|
||||
.map_err(HttpError::IntoHttp)?;
|
||||
|
||||
let method = request.method();
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ impl MatrixAuth {
|
||||
|
||||
match request {
|
||||
Ok(req) => Ok(req.uri().to_string()),
|
||||
Err(err) => Err(Error::from(HttpError::from(err))),
|
||||
Err(err) => Err(Error::from(HttpError::IntoHttp(err))),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user