Skip to content

Commit

Permalink
chore: fix build warning for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Oct 24, 2024
1 parent 72beacc commit a03006a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/shadowsocks-service/src/local/redir/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 0 additions & 2 deletions crates/shadowsocks-service/src/server/udprelay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/shadowsocks/src/net/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions src/service/local.rs
Original file line number Diff line number Diff line change
@@ -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},
};

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit a03006a

Please sign in to comment.