Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
timokroeger committed Jul 19, 2023
1 parent 710c143 commit d6caec5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use kbremap::{Config, KeyAction, Layout, VirtualKeyboard};
use windows_sys::Win32::UI::Input::KeyboardAndMouse::VK_CAPITAL;
use windows_sys::Win32::UI::WindowsAndMessaging::*;

use crate::winapi::{AutoStartEntry, KeyEvent, KeyType, KeyboardHook, PopupMenu, TrayIcon, Icon};
use crate::winapi::{AutoStartEntry, Icon, KeyEvent, KeyType, KeyboardHook, PopupMenu, TrayIcon};

fn config_path(config_file: &OsStr) -> Result<PathBuf> {
let mut path_buf;
Expand Down
12 changes: 10 additions & 2 deletions src/winapi/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ pub struct Icon(pub HICON);

impl Icon {
pub fn from_rc_numeric(id: u16) -> Self {
let hicon =
unsafe { LoadImageA(GetModuleHandleA(ptr::null()), id as _, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE) };
let hicon = unsafe {
LoadImageA(
GetModuleHandleA(ptr::null()),
id as _,
IMAGE_ICON,
0,
0,
LR_DEFAULTSIZE,
)
};
assert_ne!(hicon, 0, "icon resource {} not found", id);
Self(hicon)
}
Expand Down

0 comments on commit d6caec5

Please sign in to comment.