diff --git a/eoc/eoc-rs/crates/eoc-meter/src/lib.rs b/eoc/eoc-rs/crates/eoc-meter/src/lib.rs index fa24bebeb..9b7b4fddd 100644 --- a/eoc/eoc-rs/crates/eoc-meter/src/lib.rs +++ b/eoc/eoc-rs/crates/eoc-meter/src/lib.rs @@ -1617,6 +1617,9 @@ mod macos_ioreport { ) -> bool; } + // Three distinct frameworks, each legitimately `kind = "framework"`; the + // lint mis-reads the repeated key across separate `#[link]`s as a duplicate. + #[allow(clippy::duplicated_attributes)] #[link(name = "IOReport", kind = "dylib")] #[link(name = "IOKit", kind = "framework")] #[link(name = "CoreFoundation", kind = "framework")] @@ -2010,7 +2013,7 @@ mod macos_ioreport { unsafe { let key = CFStringCreateWithCString( std::ptr::null_mut(), - b"IOReportChannels\0".as_ptr() as *const _, + c"IOReportChannels".as_ptr() as *const _, K_CFSTRING_ENCODING_UTF8, ); if key.is_null() { diff --git a/jouleclaw/jouleclaw-rs/crates/jouleclaw-energy/src/apple_ioreport.rs b/jouleclaw/jouleclaw-rs/crates/jouleclaw-energy/src/apple_ioreport.rs index a80744e7c..ec54c7653 100644 --- a/jouleclaw/jouleclaw-rs/crates/jouleclaw-energy/src/apple_ioreport.rs +++ b/jouleclaw/jouleclaw-rs/crates/jouleclaw-energy/src/apple_ioreport.rs @@ -131,7 +131,9 @@ unsafe extern "C" { // IOReport's symbols live in the dyld shared cache (no on-disk framework // bundle since Big Sur), so link it as a dylib; IOKit + CoreFoundation are -// real frameworks. +// real frameworks. Clippy mis-reads the repeated `kind` key across separate +// `#[link]`s as a duplicate attribute. +#[allow(clippy::duplicated_attributes)] #[link(name = "IOReport", kind = "dylib")] #[link(name = "IOKit", kind = "framework")] #[link(name = "CoreFoundation", kind = "framework")] @@ -1037,7 +1039,7 @@ fn sum_energy_uj(delta: CFDictionaryRef) -> u64 { unsafe { let key = CFStringCreateWithCString( std::ptr::null_mut(), - b"IOReportChannels\0".as_ptr() as *const _, + c"IOReportChannels".as_ptr() as *const _, K_CFSTRING_ENCODING_UTF8, ); if key.is_null() { diff --git a/proof/proof-rs/crates/proof-cascade/src/meter.rs b/proof/proof-rs/crates/proof-cascade/src/meter.rs index 25f61049c..a3052fc20 100644 --- a/proof/proof-rs/crates/proof-cascade/src/meter.rs +++ b/proof/proof-rs/crates/proof-cascade/src/meter.rs @@ -3189,6 +3189,9 @@ mod macos_ioreport { ) -> bool; } + // Three distinct frameworks, each legitimately `kind = "framework"`; the + // lint mis-reads the repeated key across separate `#[link]`s as a duplicate. + #[allow(clippy::duplicated_attributes)] #[link(name = "IOReport", kind = "dylib")] #[link(name = "IOKit", kind = "framework")] #[link(name = "CoreFoundation", kind = "framework")] @@ -3422,7 +3425,7 @@ mod macos_ioreport { unsafe fn sum_energy_uj(delta: CFDictionaryRef) -> u64 { let key = CFStringCreateWithCString( std::ptr::null_mut(), - b"IOReportChannels\0".as_ptr() as *const _, + c"IOReportChannels".as_ptr() as *const _, K_CFSTRING_ENCODING_UTF8, ); if key.is_null() {