Skip to content

Commit c656ad4

Browse files
committed
sdk: prefer direct use of IntoHttp ctor instead of implicit #[from] conversions
1 parent c33a7b7 commit c656ad4

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

crates/matrix-sdk/src/authentication/qrcode/rendezvous_channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn response_to_error(status: StatusCode, body: Vec<u8>) -> HttpError {
9696

9797
error.into()
9898
}
99-
Err(e) => e.into(),
99+
Err(e) => HttpError::IntoHttp(e),
100100
}
101101
}
102102

crates/matrix-sdk/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub enum HttpError {
9898

9999
/// An error converting between ruma_client_api types and Hyper types.
100100
#[error(transparent)]
101-
IntoHttp(#[from] IntoHttpError),
101+
IntoHttp(IntoHttpError),
102102

103103
/// An error occurred while refreshing the access token.
104104
#[error(transparent)]

crates/matrix-sdk/src/http_client/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ impl HttpClient {
150150
}
151151
}
152152

153-
let request =
154-
self.serialize_request(request, config, homeserver, access_token, server_versions)?;
153+
let request = self
154+
.serialize_request(request, config, homeserver, access_token, server_versions)
155+
.map_err(HttpError::IntoHttp)?;
155156

156157
let method = request.method();
157158

crates/matrix-sdk/src/matrix_auth/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl MatrixAuth {
132132

133133
match request {
134134
Ok(req) => Ok(req.uri().to_string()),
135-
Err(err) => Err(Error::from(HttpError::from(err))),
135+
Err(err) => Err(Error::from(HttpError::IntoHttp(err))),
136136
}
137137
}
138138

0 commit comments

Comments
 (0)