1- #![ allow( unused) ]
21use std:: {
32 error:: Error as StdError ,
43 fmt,
@@ -131,13 +130,13 @@ impl TcpKeepaliveConfig {
131130 dirty = true
132131 }
133132
134- /// Set the value of the `TCP_KEEPINTVL` option. On Windows, this sets the
135- /// value of the `tcp_keepalive` struct's `keepaliveinterval` field.
136- ///
137- /// Sets the time interval between TCP keepalive probes.
138- ///
139- /// Some platforms specify this value in seconds, so sub-second
140- /// specifications may be omitted.
133+ // Set the value of the `TCP_KEEPINTVL` option. On Windows, this sets the
134+ // value of the `tcp_keepalive` struct's `keepaliveinterval` field.
135+ //
136+ // Sets the time interval between TCP keepalive probes.
137+ //
138+ // Some platforms specify this value in seconds, so sub-second
139+ // specifications may be omitted.
141140 #[ cfg( any(
142141 target_os = "android" ,
143142 target_os = "dragonfly" ,
@@ -161,10 +160,10 @@ impl TcpKeepaliveConfig {
161160 } ;
162161 }
163162
164- /// Set the value of the `TCP_KEEPCNT` option.
165- ///
166- /// Set the maximum number of TCP keepalive probes that will be sent before
167- /// dropping a connection, if TCP keepalive is enabled on this socket.
163+ // Set the value of the `TCP_KEEPCNT` option.
164+ //
165+ // Set the maximum number of TCP keepalive probes that will be sent before
166+ // dropping a connection, if TCP keepalive is enabled on this socket.
168167 #[ cfg( any(
169168 target_os = "android" ,
170169 target_os = "dragonfly" ,
@@ -311,6 +310,7 @@ impl<R> HttpConnector<R> {
311310 /// Default is 300 milliseconds.
312311 ///
313312 /// [RFC 6555]: https://tools.ietf.org/html/rfc6555
313+ #[ allow( unused) ]
314314 #[ inline]
315315 pub fn set_happy_eyeballs_timeout ( & mut self , dur : Option < Duration > ) {
316316 self . config_mut ( ) . happy_eyeballs_timeout = dur;
@@ -456,8 +456,8 @@ where
456456
457457 let sock = c. connect ( ) . await ?;
458458
459- if let Err ( e ) = sock. set_nodelay ( config. nodelay ) {
460- warn ! ( "tcp set_nodelay error: {}" , e ) ;
459+ if let Err ( _e ) = sock. set_nodelay ( config. nodelay ) {
460+ warn ! ( "tcp set_nodelay error: {_e}" ) ;
461461 }
462462
463463 Ok ( TokioIo :: new ( sock) )
@@ -731,8 +731,8 @@ fn connect(
731731 . map_err ( ConnectError :: m ( "tcp set_nonblocking error" ) ) ?;
732732
733733 if let Some ( tcp_keepalive) = & config. tcp_keepalive_config . into_tcpkeepalive ( ) {
734- if let Err ( e ) = socket. set_tcp_keepalive ( tcp_keepalive) {
735- warn ! ( "tcp set_keepalive error: {}" , e ) ;
734+ if let Err ( _e ) = socket. set_tcp_keepalive ( tcp_keepalive) {
735+ warn ! ( "tcp set_keepalive error: {_e}" ) ;
736736 }
737737 }
738738
@@ -783,6 +783,7 @@ fn connect(
783783 io:: Error :: last_os_error ( ) ,
784784 )
785785 } ) ?;
786+
786787 // Different setsockopt calls are necessary depending on whether the
787788 // address is IPv4 or IPv6.
788789 match addr {
@@ -795,8 +796,8 @@ fn connect(
795796
796797 #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
797798 if let Some ( tcp_user_timeout) = & config. tcp_user_timeout {
798- if let Err ( e ) = socket. set_tcp_user_timeout ( Some ( * tcp_user_timeout) ) {
799- warn ! ( "tcp set_tcp_user_timeout error: {}" , e ) ;
799+ if let Err ( _e ) = socket. set_tcp_user_timeout ( Some ( * tcp_user_timeout) ) {
800+ warn ! ( "tcp set_tcp_user_timeout error: {_e}" ) ;
800801 }
801802 }
802803
@@ -823,6 +824,7 @@ fn connect(
823824 use std:: os:: unix:: io:: { FromRawFd , IntoRawFd } ;
824825 TcpSocket :: from_raw_fd ( socket. into_raw_fd ( ) )
825826 } ;
827+
826828 #[ cfg( windows) ]
827829 let socket = unsafe {
828830 // Safety: `from_raw_socket` is only safe to call if ownership of the raw
@@ -834,20 +836,20 @@ fn connect(
834836 } ;
835837
836838 if config. reuse_address {
837- if let Err ( e ) = socket. set_reuseaddr ( true ) {
838- warn ! ( "tcp set_reuse_address error: {}" , e ) ;
839+ if let Err ( _e ) = socket. set_reuseaddr ( true ) {
840+ warn ! ( "tcp set_reuse_address error: {_e}" ) ;
839841 }
840842 }
841843
842844 if let Some ( size) = config. send_buffer_size {
843- if let Err ( e ) = socket. set_send_buffer_size ( size. try_into ( ) . unwrap_or ( u32:: MAX ) ) {
844- warn ! ( "tcp set_buffer_size error: {}" , e ) ;
845+ if let Err ( _e ) = socket. set_send_buffer_size ( size. try_into ( ) . unwrap_or ( u32:: MAX ) ) {
846+ warn ! ( "tcp set_buffer_size error: {_e}" ) ;
845847 }
846848 }
847849
848850 if let Some ( size) = config. recv_buffer_size {
849- if let Err ( e ) = socket. set_recv_buffer_size ( size. try_into ( ) . unwrap_or ( u32:: MAX ) ) {
850- warn ! ( "tcp set_recv_buffer_size error: {}" , e ) ;
851+ if let Err ( _e ) = socket. set_recv_buffer_size ( size. try_into ( ) . unwrap_or ( u32:: MAX ) ) {
852+ warn ! ( "tcp set_recv_buffer_size error: {_e}" ) ;
851853 }
852854 }
853855
0 commit comments