From 888e3bdf0c6ef43a3c31de8787806f29c5aba3eb Mon Sep 17 00:00:00 2001 From: William Light Date: Fri, 11 Sep 2020 18:32:55 +0200 Subject: [PATCH] windows: nitpicky code aesthetics --- src/win/window.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/win/window.rs b/src/win/window.rs index 955bb21..0d69f00 100644 --- a/src/win/window.rs +++ b/src/win/window.rs @@ -189,13 +189,17 @@ impl Window { }; // todo: add check flags https://github.com/wrl/rutabaga/blob/f30ff67e157375cafdbafe5fb549f1790443a3a8/src/platform/win/window.c#L351 - let mut parent = null_mut(); - if let WithParent(p) = options.parent { - parent = p; - flags = WS_CHILD | WS_VISIBLE; - } else { - AdjustWindowRectEx(&mut rect, flags, FALSE, 0); - } + let parent = match options.parent { + WithParent(p) => { + flags = WS_CHILD | WS_VISIBLE; + p + }, + + _ => { + AdjustWindowRectEx(&mut rect, flags, FALSE, 0); + null_mut() + } + }; let hwnd = CreateWindowExA( 0,