Skip to content

Commit

Permalink
chore(deps): update windows-sys crate to 0.59
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Aug 15, 2024
1 parent 095fcb0 commit 8b13a61
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changes/send-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"global-hotkey": "minor"
---

Removed `Sync` and `Send` implementation for `GlobalHotKeyManager`
5 changes: 5 additions & 0 deletions .changes/windows-sys-0.59.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"global-hotkey": "patch"
---

Update `windows-sys` crate to `0.59`
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cocoa = "0.25"
objc = "0.2"

[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
version = "0.52"
version = "0.59"
features = [
"Win32_UI_WindowsAndMessaging",
"Win32_Foundation",
Expand Down
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,3 @@ impl GlobalHotKeyManager {
Ok(())
}
}

#[cfg(test)]
mod tests {
fn assert_send<T: Send>() {}
fn assert_sync<T: Sync>() {}

#[test]
fn is_send_sync() {
assert_send::<super::GlobalHotKeyManager>();
assert_sync::<super::GlobalHotKeyManager>();
}
}
10 changes: 5 additions & 5 deletions src/platform_impl/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use windows_sys::Win32::{
UI::{
Input::KeyboardAndMouse::*,
WindowsAndMessaging::{
CreateWindowExW, DefWindowProcW, DestroyWindow, RegisterClassW, CW_USEDEFAULT, HMENU,
CreateWindowExW, DefWindowProcW, DestroyWindow, RegisterClassW, CW_USEDEFAULT,
WM_HOTKEY, WNDCLASSW, WS_EX_LAYERED, WS_EX_NOACTIVATE, WS_EX_TOOLWINDOW,
WS_EX_TRANSPARENT, WS_OVERLAPPED,
},
Expand All @@ -20,7 +20,7 @@ use windows_sys::Win32::{
use crate::{hotkey::HotKey, GlobalHotKeyEvent};

pub struct GlobalHotKeyManager {
hwnd: isize,
hwnd: HWND,
}

impl Drop for GlobalHotKeyManager {
Expand Down Expand Up @@ -61,12 +61,12 @@ impl GlobalHotKeyManager {
0,
CW_USEDEFAULT,
0,
HWND::default(),
HMENU::default(),
std::ptr::null_mut(),
std::ptr::null_mut(),
hinstance,
std::ptr::null_mut(),
);
if hwnd == 0 {
if hwnd.is_null() {
return Err(crate::Error::OsError(std::io::Error::last_os_error()));
}

Expand Down

0 comments on commit 8b13a61

Please sign in to comment.