We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e562afa commit da47391Copy full SHA for da47391
src/reply.rs
@@ -411,18 +411,24 @@ impl Reply for ::http::StatusCode {
411
}
412
413
414
-impl<T> Reply for Result<T, ::http::Error>
+impl Reply for ::http::Error {
415
+ #[inline]
416
+ fn into_response(self) -> Response {
417
+ tracing::error!("reply error: {:?}", self);
418
+ StatusCode::INTERNAL_SERVER_ERROR.into_response()
419
+ }
420
+}
421
+
422
+impl<T, E> Reply for Result<T, E>
423
where
- T: Reply + Send,
424
+ T: Reply,
425
+ E: Reply,
426
{
427
#[inline]
428
fn into_response(self) -> Response {
429
match self {
430
Ok(t) => t.into_response(),
- Err(e) => {
- tracing::error!("reply error: {:?}", e);
- StatusCode::INTERNAL_SERVER_ERROR.into_response()
- }
431
+ Err(e) => e.into_response(),
432
433
434
0 commit comments