File tree Expand file tree Collapse file tree 4 files changed +23
-30
lines changed Expand file tree Collapse file tree 4 files changed +23
-30
lines changed Original file line number Diff line number Diff line change @@ -96,18 +96,16 @@ where
96
96
}
97
97
}
98
98
99
- #[ allow( clippy:: from_over_into) ]
100
- impl < T : AsRef < str > > Into < Response > for Redirect < T > {
101
- fn into ( self ) -> Response {
102
- ( & self ) . into ( )
99
+ impl < T : AsRef < str > > From < Redirect < T > > for Response {
100
+ fn from ( redirect : Redirect < T > ) -> Response {
101
+ redirect. into ( )
103
102
}
104
103
}
105
104
106
- #[ allow( clippy:: from_over_into) ]
107
- impl < T : AsRef < str > > Into < Response > for & Redirect < T > {
108
- fn into ( self ) -> Response {
109
- let mut res = Response :: new ( self . status ) ;
110
- res. insert_header ( LOCATION , self . location . as_ref ( ) ) ;
105
+ impl < T : AsRef < str > > From < & Redirect < T > > for Response {
106
+ fn from ( redirect : & Redirect < T > ) -> Response {
107
+ let mut res = Response :: new ( redirect. status ) ;
108
+ res. insert_header ( LOCATION , redirect. location . as_ref ( ) ) ;
111
109
res
112
110
}
113
111
}
Original file line number Diff line number Diff line change @@ -557,25 +557,22 @@ impl<State> Read for Request<State> {
557
557
}
558
558
}
559
559
560
- #[ allow( clippy:: from_over_into) ]
561
- impl < State > Into < http:: Request > for Request < State > {
562
- fn into ( self ) -> http:: Request {
563
- self . req
560
+ impl < State > From < Request < State > > for http:: Request {
561
+ fn from ( request : Request < State > ) -> http:: Request {
562
+ request. req
564
563
}
565
564
}
566
565
567
- #[ allow( clippy:: from_over_into) ]
568
- impl < State : Default > Into < Request < State > > for http_types:: Request {
569
- fn into ( self ) -> Request < State > {
570
- Request :: new ( State :: default ( ) , self , Vec :: < Params > :: new ( ) )
566
+ impl < State : Default > From < http_types:: Request > for Request < State > {
567
+ fn from ( request : http_types:: Request ) -> Request < State > {
568
+ Request :: new ( State :: default ( ) , request, Vec :: < Params > :: new ( ) )
571
569
}
572
570
}
573
571
574
- #[ allow( clippy:: from_over_into) ]
575
- impl < State : Clone + Send + Sync + ' static > Into < Response > for Request < State > {
576
- fn into ( mut self ) -> Response {
572
+ impl < State : Clone + Send + Sync + ' static > From < Request < State > > for Response {
573
+ fn from ( mut request : Request < State > ) -> Response {
577
574
let mut res = Response :: new ( StatusCode :: Ok ) ;
578
- res. set_body ( self . take_body ( ) ) ;
575
+ res. set_body ( request . take_body ( ) ) ;
579
576
res
580
577
}
581
578
}
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ impl Response {
301
301
/// Sets the response's error, overwriting any existing error.
302
302
///
303
303
/// This is particularly useful for middleware which would like to notify further
304
- /// middleware that an error has occured without overwriting the existing response.
304
+ /// middleware that an error has occurred without overwriting the existing response.
305
305
pub fn set_error ( & mut self , error : impl Into < Error > ) {
306
306
self . error = Some ( error. into ( ) ) ;
307
307
}
@@ -356,10 +356,9 @@ impl AsMut<http::Headers> for Response {
356
356
}
357
357
}
358
358
359
- #[ allow( clippy:: from_over_into) ]
360
- impl Into < http:: Response > for Response {
361
- fn into ( self ) -> http_types:: Response {
362
- self . res
359
+ impl From < Response > for http:: Response {
360
+ fn from ( response : Response ) -> http_types:: Response {
361
+ response. res
363
362
}
364
363
}
365
364
Original file line number Diff line number Diff line change @@ -77,9 +77,8 @@ impl ResponseBuilder {
77
77
}
78
78
}
79
79
80
- #[ allow( clippy:: from_over_into) ]
81
- impl Into < Response > for ResponseBuilder {
82
- fn into ( self ) -> Response {
83
- self . build ( )
80
+ impl From < ResponseBuilder > for Response {
81
+ fn from ( response_builder : ResponseBuilder ) -> Response {
82
+ response_builder. build ( )
84
83
}
85
84
}
You can’t perform that action at this time.
0 commit comments