Fix warnings and deny future ones in CI

This commit is contained in:
ComplexSpaces 2022-06-08 23:34:37 -05:00
parent 5f0fb88c55
commit 39a2e08890
2 changed files with 11 additions and 7 deletions

View file

@ -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

View file

@ -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<F: FnOnce()> {
callback: Option<F>,
}
#[cfg(any(windows, unix))]
#[cfg(any(windows, all(unix, not(target_os = "macos"))))]
impl<F: FnOnce()> ScopeGuard<F> {
#[cfg_attr(all(windows, not(feature = "image-data")), allow(dead_code))]
pub(crate) fn new(callback: F) -> Self {
@ -151,7 +151,7 @@ impl<F: FnOnce()> ScopeGuard<F> {
}
}
#[cfg(any(windows, unix))]
#[cfg(any(windows, all(unix, not(target_os = "macos"))))]
impl<F: FnOnce()> Drop for ScopeGuard<F> {
fn drop(&mut self) {
if let Some(callback) = self.callback.take() {