diff options
author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2015-01-18 20:22:33 +1100 |
---|---|---|
committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2015-01-18 20:22:33 +1100 |
commit | 1891764afd315db61aa1c34b127e862cb1f5aed7 (patch) | |
tree | f08052eb65f35006a6368e377fa31986037088cb /src/osx | |
parent | f8f2950afd44747dfcde057134f72a15db0c5bd3 (diff) | |
download | glutin-1891764afd315db61aa1c34b127e862cb1f5aed7.tar.gz glutin-1891764afd315db61aa1c34b127e862cb1f5aed7.zip |
Clean up pattern matches
Diffstat (limited to 'src/osx')
-rw-r--r-- | src/osx/mod.rs | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/osx/mod.rs b/src/osx/mod.rs index 5ef1c65..58b6176 100644 --- a/src/osx/mod.rs +++ b/src/osx/mod.rs @@ -208,27 +208,25 @@ impl Window { fn create_window(dimensions: (u32, u32), title: &str, monitor: Option<MonitorID>) -> Option<id> { unsafe { - let scr_frame = match monitor { - Some(_) => { - let screen = NSScreen::mainScreen(nil); - NSScreen::frame(screen) - } - None => { - let (width, height) = dimensions; - NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64)) - } + let frame = if monitor.is_some() { + let screen = NSScreen::mainScreen(nil); + NSScreen::frame(screen) + } else { + let (width, height) = dimensions; + NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64)) }; - let masks = match monitor { - Some(_) => NSBorderlessWindowMask as NSUInteger, - None => NSTitledWindowMask as NSUInteger | - NSClosableWindowMask as NSUInteger | - NSMiniaturizableWindowMask as NSUInteger | - NSResizableWindowMask as NSUInteger, + let masks = if monitor.is_some() { + NSBorderlessWindowMask as NSUInteger + } else { + NSTitledWindowMask as NSUInteger | + NSClosableWindowMask as NSUInteger | + NSMiniaturizableWindowMask as NSUInteger | + NSResizableWindowMask as NSUInteger }; let window = NSWindow::alloc(nil).initWithContentRect_styleMask_backing_defer_( - scr_frame, + frame, masks, NSBackingStoreBuffered, false, |