chore: fix windows build

This commit is contained in:
eric committed 2023-09-26 09:46:09 +08:00
1 parent f6a4322a29
commit 22ee67d6c7
1 file changed
+2 -2
+2 -2
View File
@@ -18,7 +18,7 @@ use tracing::trace;
#[cfg(unix)]
use std::os::unix::io::{AsFd, AsRawFd};
#[cfg(windows)]
use std::os::windows::io::AsRawSocket;
use std::os::windows::io::{AsRawSocket, AsSocket};
#[cfg(target_os = "android")]
use {
std::os::unix::io::RawFd, tokio::io::AsyncReadExt, tokio::io::AsyncWriteExt,
@@ -339,7 +339,7 @@ fn apply_socket_opts<S: AsFd>(socket: &S) -> io::Result<()> {
apply_socket_opts_internal(sock_ref)
}
#[cfg(windows)]
fn apply_socket_opts<S: AsRawSocket>(socket: &S) -> io::Result<()> {
fn apply_socket_opts<S: AsSocket>(socket: &S) -> io::Result<()> {
let sock_ref = SockRef::from(socket);
apply_socket_opts_internal(sock_ref)
}