@@ -26,7 +26,7 @@ use tokio::{
26
26
use tokio_tfo:: TfoStream ;
27
27
use windows_sys:: {
28
28
Win32 :: {
29
- Foundation :: { ERROR_BUFFER_OVERFLOW , ERROR_NO_DATA , ERROR_SUCCESS } ,
29
+ Foundation :: { ERROR_BUFFER_OVERFLOW , ERROR_NO_DATA , ERROR_SUCCESS , FALSE } ,
30
30
NetworkManagement :: IpHelper :: {
31
31
GAA_FLAG_SKIP_ANYCAST , GAA_FLAG_SKIP_DNS_SERVER , GAA_FLAG_SKIP_MULTICAST , GAA_FLAG_SKIP_UNICAST ,
32
32
GetAdaptersAddresses , IP_ADAPTER_ADDRESSES_LH , if_nametoindex,
@@ -37,12 +37,9 @@ use windows_sys::{
37
37
WSAIoctl , htonl, setsockopt,
38
38
} ,
39
39
} ,
40
- core:: { PCSTR , BOOL } ,
40
+ core:: { BOOL , PCSTR } ,
41
41
} ;
42
42
43
- // BOOL values
44
- const FALSE : BOOL = 0 ;
45
-
46
43
use crate :: net:: {
47
44
AcceptOpts , AddrFamily , ConnectOpts , is_dual_stack_addr,
48
45
sys:: { set_common_sockopt_for_connect, socket_bind_dual_stack} ,
@@ -220,9 +217,7 @@ fn find_adapter_interface_index(addr: &SocketAddr, iface: &str) -> io::Result<Op
220
217
}
221
218
ERROR_NO_DATA => return Ok ( None ) ,
222
219
_ => {
223
- let err = io:: Error :: other (
224
- format ! ( "GetAdaptersAddresses failed with error: {}" , ret) ,
225
- ) ;
220
+ let err = io:: Error :: other ( format ! ( "GetAdaptersAddresses failed with error: {}" , ret) ) ;
226
221
return Err ( err) ;
227
222
}
228
223
}
0 commit comments