mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Improve compile times of handle_error and check_infallible (#198)
* Improve compile times of `handle_error` This brings the compile time of the example posted [here][example] from 3 seconds down to 0.3 seconds for me. Having the bounds on the methods does improve UX but not worth sacrificing 10x compile time for. [example]: https://github.com/tokio-rs/axum/issues/145#issue-963183256 * Improve compile time of `check_infallible` * update changelog
This commit is contained in:
+2
-7
@@ -453,15 +453,10 @@ impl<S, F, B> OnMethod<S, F, B> {
|
||||
/// details.
|
||||
///
|
||||
/// [`RoutingDsl::handle_error`]: crate::routing::RoutingDsl::handle_error
|
||||
pub fn handle_error<ReqBody, H, Res, E>(
|
||||
pub fn handle_error<ReqBody, H>(
|
||||
self,
|
||||
f: H,
|
||||
) -> HandleError<Self, H, ReqBody, HandleErrorFromService>
|
||||
where
|
||||
Self: Service<Request<ReqBody>, Response = Response<BoxBody>>,
|
||||
H: FnOnce(<Self as Service<Request<ReqBody>>>::Error) -> Result<Res, E>,
|
||||
Res: IntoResponse,
|
||||
{
|
||||
) -> HandleError<Self, H, ReqBody, HandleErrorFromService> {
|
||||
HandleError::new(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user