File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,15 +43,16 @@ macro_rules! generate_statuses_as_types_containing_value {
4343 impl <B : IntoBody > IntoResponse for $status<B > {
4444 #[ inline]
4545 fn into_response( self ) -> Response {
46- let body = match ( const { B :: CONTENT_TYPE } , self . body. into_body( ) ) {
47- ( "" , _) => { // will be removed by optimization if it's not
48- return Response :: OK ( ) ;
49- }
50- ( _, Err ( e) ) => {
46+ if const { B :: CONTENT_TYPE . is_empty( ) } { // will be removed by optimization if it's not
47+ return Response :: OK ( ) ;
48+ }
49+
50+ let body = match self . body. into_body( ) {
51+ Ok ( body) => body,
52+ Err ( e) => {
5153 crate :: ERROR !( "<{} as IntoBody>::into_body() failed: {e}" , std:: any:: type_name:: <B >( ) ) ;
5254 return Response :: InternalServerError ( ) ;
5355 }
54- ( _, Ok ( body) ) => body,
5556 } ;
5657
5758 let mut headers = self . headers;
You can’t perform that action at this time.
0 commit comments