diff --git a/crates/shadowsocks-service/src/local/redir/sys/mod.rs b/crates/shadowsocks-service/src/local/redir/sys/mod.rs index 5438fd2b339f..64a290d1b8bd 100644 --- a/crates/shadowsocks-service/src/local/redir/sys/mod.rs +++ b/crates/shadowsocks-service/src/local/redir/sys/mod.rs @@ -36,6 +36,6 @@ where let handle = socket.as_raw_socket(); let sock = unsafe { Socket::from_raw_socket(handle) }; let result = sock.set_only_v6(ipv6_only); - sock.into_raw_socket(); + let _ = sock.into_raw_socket(); result } diff --git a/crates/shadowsocks-service/src/server/udprelay.rs b/crates/shadowsocks-service/src/server/udprelay.rs index 5d64343b3f70..e6835454bd2d 100644 --- a/crates/shadowsocks-service/src/server/udprelay.rs +++ b/crates/shadowsocks-service/src/server/udprelay.rs @@ -28,8 +28,6 @@ use shadowsocks::{ ServerConfig, }; use tokio::{runtime::Handle, sync::mpsc, task::JoinHandle, time}; -#[cfg(windows)] -use windows_sys::Win32::Networking::WinSock::WSAEAFNOSUPPORT; use crate::net::{ packet_window::PacketWindowFilter, utils::to_ipv4_mapped, MonProxySocket, UDP_ASSOCIATION_KEEP_ALIVE_CHANNEL_SIZE, diff --git a/crates/shadowsocks/src/net/sys/mod.rs b/crates/shadowsocks/src/net/sys/mod.rs index b36033a79781..6540508e951c 100644 --- a/crates/shadowsocks/src/net/sys/mod.rs +++ b/crates/shadowsocks/src/net/sys/mod.rs @@ -87,7 +87,7 @@ where let sock = unsafe { Socket::from_raw_socket(handle) }; let result = socket_bind_dual_stack_inner(&sock, addr, ipv6_only); - sock.into_raw_socket(); + let _ = sock.into_raw_socket(); result } diff --git a/src/service/local.rs b/src/service/local.rs index 50e977d51fca..8e108e70ead9 100644 --- a/src/service/local.rs +++ b/src/service/local.rs @@ -1,11 +1,12 @@ //! Local server launchers +#[cfg(unix)] +use std::sync::Arc; use std::{ future::Future, net::IpAddr, path::PathBuf, process::ExitCode, - sync::Arc, time::{Duration, Instant}, }; @@ -1065,7 +1066,7 @@ struct ServerReloader { } impl ServerReloader { - #[cfg_attr(not(any(unix, feature = "local-online-config")), allow(dead_code))] + #[cfg_attr(not(unix), allow(dead_code))] async fn run_once(&self) -> Result<(), Box> { let start_time = Instant::now();