IOReport meters: the two clippy warnings each macOS reader carried #244
3 changed files with 12 additions and 4 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue