Skip to content

Commit e7a0973

Browse files
committed
chore: cargo fmt cleanups for emulation/macos and client_row
Pure formatting follow-ups from a code-review pass: - input-emulation/macos.rs: move CoreFoundation imports up next to their core_graphics/core-foundation siblings, and let rustfmt collapse the IOPMAssertionDeclareUserActivity unsafe-block call onto a single line. - lan-mouse-gtk/client_row.rs: rustfmt collapse of the port-title notify_local closure. No behavior change.
1 parent f9a411b commit e7a0973

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

input-emulation/src/macos.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use super::{Emulation, EmulationHandle, error::EmulationError};
22
use async_trait::async_trait;
33
use bitflags::bitflags;
4+
use core_foundation::base::{CFRelease, kCFAllocatorDefault};
5+
use core_foundation::string::{CFStringCreateWithCString, CFStringRef, kCFStringEncodingUTF8};
46
use core_graphics::base::CGFloat;
57
use core_graphics::display::{
68
CGDirectDisplayID, CGDisplay, CGDisplayBounds, CGGetDisplaysWithRect, CGPoint, CGRect, CGSize,
@@ -15,8 +17,6 @@ use input_event::{
1517
scancode,
1618
};
1719
use keycode::{KeyMap, KeyMapping};
18-
use core_foundation::base::{CFRelease, kCFAllocatorDefault};
19-
use core_foundation::string::{CFStringCreateWithCString, CFStringRef, kCFStringEncodingUTF8};
2020
use std::cell::Cell;
2121
use std::collections::HashSet;
2222
use std::ffi::{CString, c_char, c_int, c_void};
@@ -115,9 +115,8 @@ impl MacOSEmulation {
115115
return;
116116
}
117117
let mut id = self.user_activity_assertion.get();
118-
let _ret = unsafe {
119-
IOPMAssertionDeclareUserActivity(reason, K_IOPM_USER_ACTIVE_LOCAL, &mut id)
120-
};
118+
let _ret =
119+
unsafe { IOPMAssertionDeclareUserActivity(reason, K_IOPM_USER_ACTIVE_LOCAL, &mut id) };
121120
self.user_activity_assertion.set(id);
122121
unsafe { CFRelease(reason as *const c_void) };
123122
}

lan-mouse-gtk/src/client_row.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,11 @@ impl ClientRow {
8585
row_for_hostname.set_title(&collapsed_title(hostname, port));
8686
});
8787
let row_for_port = self.clone();
88-
let port_title_handler =
89-
client_object.connect_notify_local(Some("port"), move |obj, _| {
90-
let hostname: Option<String> = obj.property("hostname");
91-
let port: u32 = obj.property("port");
92-
row_for_port.set_title(&collapsed_title(hostname, port));
93-
});
88+
let port_title_handler = client_object.connect_notify_local(Some("port"), move |obj, _| {
89+
let hostname: Option<String> = obj.property("hostname");
90+
let port: u32 = obj.property("port");
91+
row_for_port.set_title(&collapsed_title(hostname, port));
92+
});
9493
self.set_title(&collapsed_title(
9594
client_object.property::<Option<String>>("hostname"),
9695
client_object.property::<u32>("port"),

0 commit comments

Comments
 (0)