aboutsummaryrefslogtreecommitdiffstats
path: root/src/osx
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2015-01-18 20:22:33 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2015-01-18 20:22:33 +1100
commit1891764afd315db61aa1c34b127e862cb1f5aed7 (patch)
treef08052eb65f35006a6368e377fa31986037088cb /src/osx
parentf8f2950afd44747dfcde057134f72a15db0c5bd3 (diff)
downloadglutin-1891764afd315db61aa1c34b127e862cb1f5aed7.tar.gz
glutin-1891764afd315db61aa1c34b127e862cb1f5aed7.zip
Clean up pattern matches
Diffstat (limited to 'src/osx')
-rw-r--r--src/osx/mod.rs30
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,