chore: fix build warning for Windows

This commit is contained in:
zonyitoo
2024-10-25 00:53:47 +08:00
parent 72beacc2f4
commit a03006a753
4 changed files with 5 additions and 6 deletions

View File

@@ -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
}

View File

@@ -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,

View File

@@ -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
}

View File

@@ -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<dyn std::error::Error>> {
let start_time = Instant::now();