File tree 6 files changed +12
-12
lines changed
6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl<B> Request<B> {
36
36
37
37
/// Read the Request Version.
38
38
#[ inline]
39
- pub fn version ( & self ) -> & HttpVersion { & self . version }
39
+ pub fn version ( & self ) -> HttpVersion { self . version }
40
40
41
41
/// Read the Request headers.
42
42
#[ inline]
Original file line number Diff line number Diff line change @@ -37,15 +37,15 @@ impl Response {
37
37
38
38
/// Get the status from the server.
39
39
#[ inline]
40
- pub fn status ( & self ) -> & status:: StatusCode { & self . status }
40
+ pub fn status ( & self ) -> status:: StatusCode { self . status }
41
41
42
42
/// Get the raw status code and reason.
43
43
#[ inline]
44
44
pub fn status_raw ( & self ) -> & RawStatus { & self . status_raw }
45
45
46
46
/// Get the HTTP version of this response from the server.
47
47
#[ inline]
48
- pub fn version ( & self ) -> & version:: HttpVersion { & self . version }
48
+ pub fn version ( & self ) -> version:: HttpVersion { self . version }
49
49
50
50
/// Take the `Body` of this response.
51
51
#[ inline]
Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ impl Request {
37
37
38
38
/// The version of HTTP for this request.
39
39
#[ inline]
40
- pub fn version ( & self ) -> & HttpVersion { & self . version }
40
+ pub fn version ( & self ) -> HttpVersion { self . version }
41
41
42
42
/// The remote socket address of this request
43
43
///
44
44
/// This is an `Option`, because some underlying transports may not have
45
45
/// a socket address, such as Unix Sockets.
46
46
#[ inline]
47
- pub fn remote_addr ( & self ) -> Option < & SocketAddr > { self . remote_addr . as_ref ( ) }
47
+ pub fn remote_addr ( & self ) -> Option < SocketAddr > { self . remote_addr }
48
48
49
49
/// The target path of this Request.
50
50
#[ inline]
Original file line number Diff line number Diff line change @@ -26,13 +26,13 @@ impl<B> Response<B> {
26
26
27
27
/// The status of this response.
28
28
#[ inline]
29
- pub fn status ( & self ) -> & StatusCode {
30
- & self . head . subject
29
+ pub fn status ( & self ) -> StatusCode {
30
+ self . head . subject
31
31
}
32
32
33
33
/// The HTTP version of this response.
34
34
#[ inline]
35
- pub fn version ( & self ) -> & version:: HttpVersion { & self . head . version }
35
+ pub fn version ( & self ) -> version:: HttpVersion { self . head . version }
36
36
37
37
/// Get a mutable reference to the Headers.
38
38
#[ inline]
Original file line number Diff line number Diff line change @@ -550,9 +550,9 @@ impl Default for StatusCode {
550
550
}
551
551
}
552
552
553
- impl Into < u16 > for StatusCode {
554
- fn into ( self ) -> u16 {
555
- self . to_u16 ( )
553
+ impl From < StatusCode > for u16 {
554
+ fn from ( code : StatusCode ) -> u16 {
555
+ code . to_u16 ( )
556
556
}
557
557
}
558
558
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ macro_rules! test {
89
89
let work = res. join( rx) . map( |r| r. 0 ) ;
90
90
91
91
let res = core. run( work) . unwrap( ) ;
92
- assert_eq!( res. status( ) , & StatusCode :: $client_status, "status is invalid" ) ;
92
+ assert_eq!( res. status( ) , StatusCode :: $client_status, "status is invalid" ) ;
93
93
$(
94
94
assert_eq!( res. headers( ) . get( ) , Some ( & $response_headers) , "headers are invalid" ) ;
95
95
) *
You can’t perform that action at this time.
0 commit comments