Skip to content

Commit 49d00ce

Browse files
committed
chore: FALSE could be found in Win32::Foundation
1 parent 16dda13 commit 49d00ce

File tree

1 file changed

+3
-8
lines changed
  • crates/shadowsocks/src/net/sys/windows

1 file changed

+3
-8
lines changed

crates/shadowsocks/src/net/sys/windows/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use tokio::{
2626
use tokio_tfo::TfoStream;
2727
use windows_sys::{
2828
Win32::{
29-
Foundation::{ERROR_BUFFER_OVERFLOW, ERROR_NO_DATA, ERROR_SUCCESS},
29+
Foundation::{ERROR_BUFFER_OVERFLOW, ERROR_NO_DATA, ERROR_SUCCESS, FALSE},
3030
NetworkManagement::IpHelper::{
3131
GAA_FLAG_SKIP_ANYCAST, GAA_FLAG_SKIP_DNS_SERVER, GAA_FLAG_SKIP_MULTICAST, GAA_FLAG_SKIP_UNICAST,
3232
GetAdaptersAddresses, IP_ADAPTER_ADDRESSES_LH, if_nametoindex,
@@ -37,12 +37,9 @@ use windows_sys::{
3737
WSAIoctl, htonl, setsockopt,
3838
},
3939
},
40-
core::{PCSTR, BOOL},
40+
core::{BOOL, PCSTR},
4141
};
4242

43-
// BOOL values
44-
const FALSE: BOOL = 0;
45-
4643
use crate::net::{
4744
AcceptOpts, AddrFamily, ConnectOpts, is_dual_stack_addr,
4845
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
220217
}
221218
ERROR_NO_DATA => return Ok(None),
222219
_ => {
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));
226221
return Err(err);
227222
}
228223
}

0 commit comments

Comments
 (0)