fix some rustfmt annoyances
This commit is contained in:
parent
877c913a0c
commit
bb18518cf6
2
.rustfmt.toml
Normal file
2
.rustfmt.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
fn_args_layout = "Compressed"
|
||||||
|
use_field_init_shorthand = true
|
|
@ -58,10 +58,7 @@ unsafe fn handle_timer<H: WindowHandler>(window_state: &RefCell<WindowState<H>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "system" fn wnd_proc<H: WindowHandler>(
|
unsafe extern "system" fn wnd_proc<H: WindowHandler>(
|
||||||
hwnd: HWND,
|
hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM,
|
||||||
msg: UINT,
|
|
||||||
wparam: WPARAM,
|
|
||||||
lparam: LPARAM,
|
|
||||||
) -> LRESULT {
|
) -> LRESULT {
|
||||||
if msg == WM_CREATE {
|
if msg == WM_CREATE {
|
||||||
PostMessageA(hwnd, WM_SHOWWINDOW, 0, 0);
|
PostMessageA(hwnd, WM_SHOWWINDOW, 0, 0);
|
||||||
|
|
|
@ -51,8 +51,7 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn window_thread<H: WindowHandler>(
|
fn window_thread<H: WindowHandler>(
|
||||||
options: WindowOpenOptions,
|
options: WindowOpenOptions, tx: mpsc::SyncSender<WindowOpenResult>,
|
||||||
tx: mpsc::SyncSender<WindowOpenResult>,
|
|
||||||
) -> WindowOpenResult {
|
) -> WindowOpenResult {
|
||||||
// Connect to the X server
|
// Connect to the X server
|
||||||
// FIXME: baseview error type instead of unwrap()
|
// FIXME: baseview error type instead of unwrap()
|
||||||
|
@ -122,9 +121,7 @@ impl Window {
|
||||||
title.as_bytes(),
|
title.as_bytes(),
|
||||||
);
|
);
|
||||||
|
|
||||||
xcb_connection
|
xcb_connection.atoms.wm_protocols
|
||||||
.atoms
|
|
||||||
.wm_protocols
|
|
||||||
.zip(xcb_connection.atoms.wm_delete_window)
|
.zip(xcb_connection.atoms.wm_delete_window)
|
||||||
.map(|(wm_protocols, wm_delete_window)| {
|
.map(|(wm_protocols, wm_delete_window)| {
|
||||||
xcb_util::icccm::set_wm_protocols(
|
xcb_util::icccm::set_wm_protocols(
|
||||||
|
@ -254,10 +251,7 @@ impl Window {
|
||||||
let data = event.data().data;
|
let data = event.data().data;
|
||||||
let (_, data32, _) = unsafe { data.align_to::<u32>() };
|
let (_, data32, _) = unsafe { data.align_to::<u32>() };
|
||||||
|
|
||||||
let wm_delete_window = self
|
let wm_delete_window = self.xcb_connection.atoms.wm_delete_window
|
||||||
.xcb_connection
|
|
||||||
.atoms
|
|
||||||
.wm_delete_window
|
|
||||||
.unwrap_or(xcb::NONE);
|
.unwrap_or(xcb::NONE);
|
||||||
|
|
||||||
if wm_delete_window == data32[0] {
|
if wm_delete_window == data32[0] {
|
||||||
|
|
Loading…
Reference in a new issue