From 93479b81112dfeef2b1646c5050c9fbd305c3288 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Wed, 11 Sep 2024 16:17:15 -0700 Subject: [PATCH] Window::clone fix --- CHANGELOG.md | 5 +++++ src/window.rs | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2d7e0..45c1b37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 and `RunningWindow::outer_position`. `RunningWindow::set_position` has been renamed to `RunningWindow::set_outer_position`. +### Fixed + +- `Window`'s `Clone` implementation no longer requires its generic parameter to + implement `Clone`. + ### Added - `PendingApp::on_startup` accepts a callback that will be invoked once the diff --git a/src/window.rs b/src/window.rs index e83d483..6107a29 100644 --- a/src/window.rs +++ b/src/window.rs @@ -22,7 +22,7 @@ use crate::{ }; /// A weak reference to a running window. -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct Window { opened: OpenedWindow, sender: Weak>>, @@ -61,6 +61,15 @@ impl Window { } } +impl Clone for Window { + fn clone(&self) -> Self { + Self { + opened: self.opened.clone(), + sender: self.sender.clone(), + } + } +} + /// A builder for a window. /// /// This type is similar to winit's