From 793d28ab845b749b908fa06b0072aa662cb6acf5 Mon Sep 17 00:00:00 2001 From: Haim Gelfenbeyn Date: Tue, 5 Nov 2024 07:07:12 -0500 Subject: [PATCH] Removed unneeded accessor --- src/arm.rs | 10 +++++----- src/iokit/wrappers.rs | 5 ----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/arm.rs b/src/arm.rs index 4bb32d2..a2ac4f3 100644 --- a/src/arm.rs +++ b/src/arm.rs @@ -73,14 +73,14 @@ pub(crate) fn get_display_av_service(display: CGDisplay) -> Result<(IOAVService, let mut iter = IoIterator::root()?; while let Some(service) = iter.next() { - if let Ok(registry_location) = get_service_registry_entry_path(service.as_raw()) { + if let Ok(registry_location) = get_service_registry_entry_path((&service).into()) { if registry_location == location { while let Some(service) = iter.next() { - if get_service_registry_entry_name(service.as_raw())? == "DCPAVServiceProxy" { - let av_service = unsafe { IOAVServiceCreateWithService(kCFAllocatorDefault, service.as_raw()) }; + if get_service_registry_entry_name((&service).into())? == "DCPAVServiceProxy" { + let av_service = unsafe { IOAVServiceCreateWithService(kCFAllocatorDefault, (&service).into()) }; let loc_ref = unsafe { IORegistryEntryCreateCFProperty( - service.as_raw(), + (&service).into(), CFString::from_static_string("Location").as_concrete_TypeRef(), kCFAllocatorDefault, kIORegistryIterateRecursively, @@ -109,7 +109,7 @@ fn i2c_address(service: IoObject) -> u16 { // not a standard 0x37 but 0xB7. let mut parent: io_registry_entry_t = 0; unsafe { - if IORegistryEntryGetParentEntry(service.as_raw(), kIOServicePlane, &mut parent) != KERN_SUCCESS { + if IORegistryEntryGetParentEntry((&service).into(), kIOServicePlane, &mut parent) != KERN_SUCCESS { return I2C_ADDRESS_DDC_CI; } } diff --git a/src/iokit/wrappers.rs b/src/iokit/wrappers.rs index eb4bdaa..bab65fc 100644 --- a/src/iokit/wrappers.rs +++ b/src/iokit/wrappers.rs @@ -28,11 +28,6 @@ impl IoObject { Ok(CFMutableDictionary::wrap_under_create_rule(props as _).to_immutable()) } } - - /// Accessor method to get the inner `io_object_t` - pub fn as_raw(&self) -> io_object_t { - self.0 - } } impl From for IoObject {