Skip to content

Commit 1448c9a

Browse files
conditional compilation style fixes (#104)
1 parent cac8211 commit 1448c9a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ serde_test = "1.0"
2424
tracing = "0.1"
2525
tracing-subscriber = "0.3"
2626

27-
[target.'cfg(any(target_family = "unix"))'.dependencies]
27+
[target.'cfg(unix)'.dependencies]
2828
boringtun = { path = "boringtun/boringtun", default-features = false, features = [
2929
"device",
3030
] }

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub enum WireguardInterfaceError {
4747
#[cfg(target_os = "windows")]
4848
#[error(transparent)]
4949
WindowsError(#[from] WindowsError),
50-
#[cfg(target_family = "unix")]
50+
#[cfg(unix)]
5151
#[error("BoringTun {0}")]
5252
BoringTun(#[from] boringtun::device::Error),
5353
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ mod dependencies;
6767
mod wgapi_freebsd;
6868
#[cfg(target_os = "linux")]
6969
mod wgapi_linux;
70-
#[cfg(target_family = "unix")]
70+
#[cfg(unix)]
7171
mod wgapi_userspace;
7272
#[cfg(target_family = "windows")]
7373
mod wgapi_windows;

src/wgapi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Shared multi-platform management API abstraction
22
use std::marker::PhantomData;
33

4-
#[cfg(target_family = "unix")]
4+
#[cfg(unix)]
55
use boringtun::device::DeviceHandle;
66
#[cfg(target_os = "windows")]
77
use wireguard_nt::Adapter;
@@ -19,7 +19,7 @@ pub struct Userspace;
1919
/// to detect the correct API implementation for most common platforms.
2020
pub struct WGApi<API = Kernel> {
2121
pub(super) ifname: String,
22-
#[cfg(target_family = "unix")]
22+
#[cfg(unix)]
2323
pub(super) device_handle: Option<DeviceHandle>,
2424
#[cfg(target_os = "windows")]
2525
pub(super) adapter: Option<Adapter>,
@@ -33,7 +33,7 @@ impl<API> WGApi<API> {
3333
check_external_dependencies()?;
3434
Ok(WGApi {
3535
ifname: ifname.into(),
36-
#[cfg(target_family = "unix")]
36+
#[cfg(unix)]
3737
device_handle: None,
3838
#[cfg(target_os = "windows")]
3939
adapter: None,

0 commit comments

Comments
 (0)