chore: update Rust to 1.95; replace cfg_if with cfg_select (#2121)

This commit is contained in:
Luna Yao
2026-04-17 17:41:31 +02:00
committed by GitHub
parent bcb2e512d4
commit fae32361f2
16 changed files with 66 additions and 94 deletions
+11 -5
View File
@@ -2,8 +2,8 @@ pub mod pnet;
use std::{io, net::SocketAddr, sync::Arc};
cfg_if::cfg_if! {
if #[cfg(target_os = "linux")] {
cfg_select! {
target_os = "linux" => {
pub mod linux_bpf;
pub fn create_tun(
@@ -26,7 +26,9 @@ cfg_if::cfg_if! {
}
}
}
} else if #[cfg(all(target_os = "macos", not(feature = "macos-ne")))] {
}
all(target_os = "macos", not(feature = "macos-ne")) => {
pub mod macos_bpf;
pub fn create_tun(
@@ -49,7 +51,9 @@ cfg_if::cfg_if! {
}
}
}
} else if #[cfg(all(windows, any(target_arch = "x86_64", target_arch = "x86")))] {
}
all(windows, any(target_arch = "x86_64", target_arch = "x86")) => {
pub mod windivert;
pub fn create_tun(
@@ -72,7 +76,9 @@ cfg_if::cfg_if! {
}
}
}
} else {
}
_ => {
pub fn create_tun(
interface_name: &str,
src_addr: Option<SocketAddr>,