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
9696 }
9797}
9898
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 ( )
103102 }
104103}
105104
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 ( ) ) ;
111109 res
112110 }
113111}
Original file line number Diff line number Diff line change @@ -570,25 +570,22 @@ impl<State> Read for Request<State> {
570570 }
571571}
572572
573- #[ allow( clippy:: from_over_into) ]
574- impl < State > Into < http:: Request > for Request < State > {
575- fn into ( self ) -> http:: Request {
576- self . req
573+ impl < State > From < Request < State > > for http:: Request {
574+ fn from ( request : Request < State > ) -> http:: Request {
575+ request. req
577576 }
578577}
579578
580- #[ allow( clippy:: from_over_into) ]
581- impl < State : Default > Into < Request < State > > for http_types:: Request {
582- fn into ( self ) -> Request < State > {
583- Request :: new ( State :: default ( ) , self , Vec :: < Params > :: new ( ) )
579+ impl < State : Default > From < http_types:: Request > for Request < State > {
580+ fn from ( request : http_types:: Request ) -> Request < State > {
581+ Request :: new ( State :: default ( ) , request, Vec :: < Params > :: new ( ) )
584582 }
585583}
586584
587- #[ allow( clippy:: from_over_into) ]
588- impl < State : Clone + Send + Sync + ' static > Into < Response > for Request < State > {
589- fn into ( mut self ) -> Response {
585+ impl < State : Clone + Send + Sync + ' static > From < Request < State > > for Response {
586+ fn from ( mut request : Request < State > ) -> Response {
590587 let mut res = Response :: new ( StatusCode :: Ok ) ;
591- res. set_body ( self . take_body ( ) ) ;
588+ res. set_body ( request . take_body ( ) ) ;
592589 res
593590 }
594591}
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ impl Response {
301301 /// Sets the response's error, overwriting any existing error.
302302 ///
303303 /// 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.
305305 pub fn set_error ( & mut self , error : impl Into < Error > ) {
306306 self . error = Some ( error. into ( ) ) ;
307307 }
@@ -356,10 +356,9 @@ impl AsMut<http::Headers> for Response {
356356 }
357357}
358358
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
363362 }
364363}
365364
Original file line number Diff line number Diff line change @@ -77,9 +77,8 @@ impl ResponseBuilder {
7777 }
7878}
7979
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 ( )
8483 }
8584}
You can’t perform that action at this time.
0 commit comments