Window::clone fix

This commit is contained in:
Jonathan Johnson 2024-09-11 16:17:15 -07:00
parent 6c59e6942f
commit 93479b8111
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 15 additions and 1 deletions

View file

@ -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 and `RunningWindow::outer_position`. `RunningWindow::set_position` has been
renamed to `RunningWindow::set_outer_position`. renamed to `RunningWindow::set_outer_position`.
### Fixed
- `Window`'s `Clone` implementation no longer requires its generic parameter to
implement `Clone`.
### Added ### Added
- `PendingApp::on_startup` accepts a callback that will be invoked once the - `PendingApp::on_startup` accepts a callback that will be invoked once the

View file

@ -22,7 +22,7 @@ use crate::{
}; };
/// A weak reference to a running window. /// A weak reference to a running window.
#[derive(Debug, Clone)] #[derive(Debug)]
pub struct Window<Message> { pub struct Window<Message> {
opened: OpenedWindow, opened: OpenedWindow,
sender: Weak<mpsc::SyncSender<WindowMessage<Message>>>, sender: Weak<mpsc::SyncSender<WindowMessage<Message>>>,
@ -61,6 +61,15 @@ impl<Message> Window<Message> {
} }
} }
impl<Message> Clone for Window<Message> {
fn clone(&self) -> Self {
Self {
opened: self.opened.clone(),
sender: self.sender.clone(),
}
}
}
/// A builder for a window. /// A builder for a window.
/// ///
/// This type is similar to winit's /// This type is similar to winit's