From 3aab801f291c513f5b662589097fa5d5653d8ffe Mon Sep 17 00:00:00 2001 From: Tomaka17 Date: Wed, 13 Aug 2014 14:52:12 +0200 Subject: [PATCH] Implement Default for Window --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d7cb97f1..3cc3518f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,8 @@ extern crate libc; pub use events::*; +use std::default::Default; + #[cfg(target_os = "win32")] use winimpl = win32; #[cfg(target_os = "linux")] @@ -145,6 +147,12 @@ pub struct Window { window: winimpl::Window, } +impl Default for Window { + fn default() -> Window { + Window::new().unwrap() + } +} + impl Window { /// Creates a new OpenGL context, and a Window for platforms where this is appropriate. ///