diff --git a/Cargo.toml b/Cargo.toml index fe11c87..d546c40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde_test = "1.0" tracing = "0.1" tracing-subscriber = "0.3" -[target.'cfg(any(target_family = "unix"))'.dependencies] +[target.'cfg(unix)'.dependencies] boringtun = { path = "boringtun/boringtun", default-features = false, features = [ "device", ] } diff --git a/src/error.rs b/src/error.rs index 7dc7b9b..7442023 100644 --- a/src/error.rs +++ b/src/error.rs @@ -47,7 +47,7 @@ pub enum WireguardInterfaceError { #[cfg(target_os = "windows")] #[error(transparent)] WindowsError(#[from] WindowsError), - #[cfg(target_family = "unix")] + #[cfg(unix)] #[error("BoringTun {0}")] BoringTun(#[from] boringtun::device::Error), } diff --git a/src/lib.rs b/src/lib.rs index 6750b1c..1eaad69 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,7 +67,7 @@ mod dependencies; mod wgapi_freebsd; #[cfg(target_os = "linux")] mod wgapi_linux; -#[cfg(target_family = "unix")] +#[cfg(unix)] mod wgapi_userspace; #[cfg(target_family = "windows")] mod wgapi_windows; diff --git a/src/wgapi.rs b/src/wgapi.rs index 14f040a..561b1f6 100644 --- a/src/wgapi.rs +++ b/src/wgapi.rs @@ -1,7 +1,7 @@ //! Shared multi-platform management API abstraction use std::marker::PhantomData; -#[cfg(target_family = "unix")] +#[cfg(unix)] use boringtun::device::DeviceHandle; #[cfg(target_os = "windows")] use wireguard_nt::Adapter; @@ -19,7 +19,7 @@ pub struct Userspace; /// to detect the correct API implementation for most common platforms. pub struct WGApi { pub(super) ifname: String, - #[cfg(target_family = "unix")] + #[cfg(unix)] pub(super) device_handle: Option, #[cfg(target_os = "windows")] pub(super) adapter: Option, @@ -33,7 +33,7 @@ impl WGApi { check_external_dependencies()?; Ok(WGApi { ifname: ifname.into(), - #[cfg(target_family = "unix")] + #[cfg(unix)] device_handle: None, #[cfg(target_os = "windows")] adapter: None,