File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88# Unreleased
99
1010- ** added:** Implement ` From<Bytes> ` for ` Message ` ([ #3273 ] )
11+ - ** changed:** Improved code size / compile time of ` Handler ` implementations ([ #3285 ] )
1112
1213[ #3273 ] : https://github.com/tokio-rs/axum/pull/3273
14+ [ #3285 ] : https://github.com/tokio-rs/axum/pull/3285
1315
1416# 0.8.2
1517
Original file line number Diff line number Diff line change @@ -220,27 +220,23 @@ macro_rules! impl_handler {
220220 type Future = Pin <Box <dyn Future <Output = Response > + Send >>;
221221
222222 fn call( self , req: Request , state: S ) -> Self :: Future {
223+ let ( mut parts, body) = req. into_parts( ) ;
223224 Box :: pin( async move {
224- let ( mut parts, body) = req. into_parts( ) ;
225- let state = & state;
226-
227225 $(
228- let $ty = match $ty:: from_request_parts( & mut parts, state) . await {
226+ let $ty = match $ty:: from_request_parts( & mut parts, & state) . await {
229227 Ok ( value) => value,
230228 Err ( rejection) => return rejection. into_response( ) ,
231229 } ;
232230 ) *
233231
234232 let req = Request :: from_parts( parts, body) ;
235233
236- let $last = match $last:: from_request( req, state) . await {
234+ let $last = match $last:: from_request( req, & state) . await {
237235 Ok ( value) => value,
238236 Err ( rejection) => return rejection. into_response( ) ,
239237 } ;
240238
241- let res = self ( $( $ty, ) * $last, ) . await ;
242-
243- res. into_response( )
239+ self ( $( $ty, ) * $last, ) . await . into_response( )
244240 } )
245241 }
246242 }
You can’t perform that action at this time.
0 commit comments