Skip to content

Commit ec0c723

Browse files
committed
Cargo fmt
1 parent 73e0a41 commit ec0c723

4 files changed

Lines changed: 36 additions & 6 deletions

File tree

examples/foreground.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use std::{
44
ptr::{self, NonNull},
55
};
66

7-
use windows_sys::Win32::{Foundation::{GetLastError, HWND, SetLastError}, UI::WindowsAndMessaging::{GetWindowTextLengthW, GetWindowTextW}};
7+
use windows_sys::Win32::{
8+
Foundation::{GetLastError, HWND, SetLastError},
9+
UI::WindowsAndMessaging::{GetWindowTextLengthW, GetWindowTextW},
10+
};
811
use wineventhook::{AccessibleObjectId, EventFilter, WindowEventHook, raw_event};
912

1013
#[tokio::main]

src/event.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
use std::{
2-
ffi::{c_long, c_ulong, c_void}, fmt::{self, Debug}, ptr::NonNull, time::{Duration, Instant, SystemTime}
2+
ffi::{c_long, c_ulong, c_void},
3+
fmt::{self, Debug},
4+
ptr::NonNull,
5+
time::{Duration, Instant, SystemTime},
36
};
47

58
use num_enum::{FromPrimitive, IntoPrimitive};
6-
use windows_sys::Win32::{Foundation::HWND, System::SystemInformation::GetTickCount, UI::{Accessibility::HWINEVENTHOOK, WindowsAndMessaging}};
9+
use windows_sys::Win32::{
10+
Foundation::HWND,
11+
System::SystemInformation::GetTickCount,
12+
UI::{Accessibility::HWINEVENTHOOK, WindowsAndMessaging},
13+
};
714

815
use crate::raw_event;
916

src/hook.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
use std::{
2-
cell::OnceCell, ffi::{c_long, c_ulong}, fmt::Debug, hash::Hash, io, mem::MaybeUninit, num::NonZeroU32, ops::Range, ptr
2+
cell::OnceCell,
3+
ffi::{c_long, c_ulong},
4+
fmt::Debug,
5+
hash::Hash,
6+
io,
7+
mem::MaybeUninit,
8+
num::NonZeroU32,
9+
ops::Range,
10+
ptr,
311
};
412

5-
use windows_sys::Win32::{Foundation::{FALSE, HWND}, UI::{Accessibility::{HWINEVENTHOOK, SetWinEventHook, UnhookWinEvent}, WindowsAndMessaging::GetWindowThreadProcessId}};
13+
use windows_sys::Win32::{
14+
Foundation::{FALSE, HWND},
15+
UI::{
16+
Accessibility::{HWINEVENTHOOK, SetWinEventHook, UnhookWinEvent},
17+
WindowsAndMessaging::GetWindowThreadProcessId,
18+
},
19+
};
620

721
use crate::{
822
RawWindowEvent, RawWindowHandle, WindowEvent, message_loop::run_dummy_message_loop, raw_event,

src/message_loop.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
use std::{io, mem, ptr, time::Duration};
22

33
use tokio::sync::oneshot;
4-
use windows_sys::Win32::{Foundation::{FALSE, HWND, POINT, WAIT_FAILED}, UI::WindowsAndMessaging::{CreateWindowExA, DestroyWindow, HWND_MESSAGE, MSG, MsgWaitForMultipleObjects, PM_REMOVE, PeekMessageW, QS_ALLEVENTS}};
4+
use windows_sys::Win32::{
5+
Foundation::{FALSE, HWND, POINT, WAIT_FAILED},
6+
UI::WindowsAndMessaging::{
7+
CreateWindowExA, DestroyWindow, HWND_MESSAGE, MSG, MsgWaitForMultipleObjects, PM_REMOVE,
8+
PeekMessageW, QS_ALLEVENTS,
9+
},
10+
};
511

612
pub fn run_dummy_message_loop(mut abort_receiver: oneshot::Receiver<()>) -> io::Result<()> {
713
let window = MessageOnlyWindow::new()?;

0 commit comments

Comments
 (0)