From 02ac7456e438a88c3c7aeef00c86ed29638be92d Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Tue, 7 Jan 2020 20:33:56 +0100 Subject: [PATCH] impl Default for WindowBuilder (#1373) --- CHANGELOG.md | 1 + src/window.rs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3e39009..2be5dfad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - On Windows, fix bug where `RedrawRequested` would only get emitted every other iteration of the event loop. - On X11, fix deadlock on window state when handling certain window events. +- `WindowBuilder` now implements `Default`. # 0.20.0 (2020-01-05) diff --git a/src/window.rs b/src/window.rs index 073ed2fd..78de9fd4 100644 --- a/src/window.rs +++ b/src/window.rs @@ -78,7 +78,7 @@ impl WindowId { } /// Object that allows you to build windows. -#[derive(Clone)] +#[derive(Clone, Default)] pub struct WindowBuilder { /// The attributes to use to create the window. pub window: WindowAttributes, @@ -185,10 +185,7 @@ impl WindowBuilder { /// Initializes a new `WindowBuilder` with default values. #[inline] pub fn new() -> Self { - WindowBuilder { - window: Default::default(), - platform_specific: Default::default(), - } + Default::default() } /// Requests the window to be of specific dimensions.