Skip to content

Commit

Permalink
Removed unneeded accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
haimgel committed Nov 5, 2024
1 parent a8e7550 commit 793d28a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/iokit/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<io_object_t> for IoObject {
Expand Down

0 comments on commit 793d28a

Please sign in to comment.