diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c694811..e9ec6af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,26 +35,30 @@ jobs: override: true components: clippy - uses: actions/checkout@v2 + - name: Run `cargo clippy` with no features uses: actions-rs/cargo@v1 with: command: clippy - args: --verbose --no-default-features + args: --verbose --no-default-features -- -D warnings + - name: Run `cargo clippy` with `image-data` feature uses: actions-rs/cargo@v1 with: command: clippy - args: --verbose --no-default-features --features image-data + args: --verbose --no-default-features --features image-data -- -D warnings + - name: Run `cargo clippy` with `wayland-data-control` feature uses: actions-rs/cargo@v1 with: command: clippy - args: --verbose --no-default-features --features wayland-data-control + args: --verbose --no-default-features --features wayland-data-control -- -D warnings + - name: Run `cargo clippy` with all features uses: actions-rs/cargo@v1 with: command: clippy - args: --verbose --all-features + args: --verbose --all-features -- -D warnings test: needs: clippy diff --git a/src/common.rs b/src/common.rs index c90f5e5..163ed74 100644 --- a/src/common.rs +++ b/src/common.rs @@ -138,12 +138,12 @@ impl<'a> ImageData<'a> { } } -#[cfg(any(windows, unix))] +#[cfg(any(windows, all(unix, not(target_os = "macos"))))] pub(crate) struct ScopeGuard { callback: Option, } -#[cfg(any(windows, unix))] +#[cfg(any(windows, all(unix, not(target_os = "macos"))))] impl ScopeGuard { #[cfg_attr(all(windows, not(feature = "image-data")), allow(dead_code))] pub(crate) fn new(callback: F) -> Self { @@ -151,7 +151,7 @@ impl ScopeGuard { } } -#[cfg(any(windows, unix))] +#[cfg(any(windows, all(unix, not(target_os = "macos"))))] impl Drop for ScopeGuard { fn drop(&mut self) { if let Some(callback) = self.callback.take() {