From d0e420874c6356c8fb66a9365dc3bd218e9a936c Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Fri, 16 Feb 2024 09:40:29 -0800 Subject: [PATCH] refactor: add lint exceptions for clippy::manual_c_str_literals and clippy::ref_as_ptr (#108) --- crates/wdk-build/src/cargo_make.rs | 2 +- crates/wdk-sys/src/constants.rs | 7 +++++++ crates/wdk-sys/src/types.rs | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/wdk-build/src/cargo_make.rs b/crates/wdk-build/src/cargo_make.rs index 8484acb9..00ab4bd3 100644 --- a/crates/wdk-build/src/cargo_make.rs +++ b/crates/wdk-build/src/cargo_make.rs @@ -652,7 +652,7 @@ fn configure_wdf_build_output_dir(target_arg: &Option, cargo_make_cargo_ output_dir += "/debug"; } else { output_dir += "/"; - output_dir += &cargo_make_cargo_profile; + output_dir += cargo_make_cargo_profile; } output_dir diff --git a/crates/wdk-sys/src/constants.rs b/crates/wdk-sys/src/constants.rs index 81e24957..6bbee5b5 100644 --- a/crates/wdk-sys/src/constants.rs +++ b/crates/wdk-sys/src/constants.rs @@ -6,6 +6,13 @@ use crate::types::{NTSTATUS, POOL_FLAGS, PVOID, PWDF_OBJECT_ATTRIBUTES}; #[allow(non_upper_case_globals)] +#[rustversion::attr( + any( + all(not(nightly), since(1.79)), + all(nightly, since(2024-02-09)), + ), + allow(clippy::manual_c_str_literals) +)] #[allow(clippy::unreadable_literal)] mod bindings { // allow wildcards for types module since underlying c code relies on all diff --git a/crates/wdk-sys/src/types.rs b/crates/wdk-sys/src/types.rs index 46242715..bcc3616b 100644 --- a/crates/wdk-sys/src/types.rs +++ b/crates/wdk-sys/src/types.rs @@ -38,6 +38,13 @@ ), allow(clippy::pub_underscore_fields) )] +#[rustversion::attr( + any( + all(not(nightly), since(1.79)), + all(nightly, since(2024-02-09)), + ), + allow(clippy::ref_as_ptr) +)] #[allow(clippy::semicolon_if_nothing_returned)] #[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_lines)]