diff --git a/CHANGELOG.md b/CHANGELOG.md index bd20e12..e443ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- All `&Appplication` bounds now are `?Sized`, enabling `&dyn Application` + parameters. + ## v0.2.0 (2023-12-27) ### Breaking Changes diff --git a/src/window.rs b/src/window.rs index ffd8f70..0079935 100644 --- a/src/window.rs +++ b/src/window.rs @@ -66,6 +66,7 @@ pub struct WindowBuilder<'a, Behavior, Application, AppMessage> where Behavior: self::WindowBehavior, AppMessage: Message, + Application: ?Sized, { owner: &'a Application, context: Behavior::Context, @@ -76,6 +77,7 @@ impl<'a, Behavior, Application, AppMessage> Deref where Behavior: self::WindowBehavior, AppMessage: Message, + Application: ?Sized, { type Target = WindowAttributes; @@ -89,6 +91,7 @@ impl<'a, Behavior, Application, AppMessage> DerefMut where Behavior: self::WindowBehavior, AppMessage: Message, + Application: ?Sized, { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.attributes @@ -181,7 +184,7 @@ impl Default for WindowAttributes { impl<'a, Behavior, Application, AppMessage> WindowBuilder<'a, Behavior, Application, AppMessage> where Behavior: self::WindowBehavior, - Application: crate::AsApplication, + Application: crate::AsApplication + ?Sized, AppMessage: Message, { pub(crate) fn new(owner: &'a Application, context: Behavior::Context) -> Self { @@ -773,7 +776,7 @@ where /// initialized, a default [`Context`](Self::Context) will be passed. fn build(app: &App) -> WindowBuilder<'_, Self, App, AppMessage> where - App: AsApplication, + App: AsApplication + ?Sized, Self::Context: Default, { Self::build_with(app, ::default()) @@ -786,7 +789,7 @@ where context: Self::Context, ) -> WindowBuilder<'_, Self, App, AppMessage> where - App: AsApplication, + App: AsApplication + ?Sized, { WindowBuilder::new(app, context) } @@ -852,7 +855,7 @@ where /// [`winit::window::WindowBuilder::build`]. fn open(app: &App) -> Result>, OsError> where - App: AsApplication, + App: AsApplication + ?Sized, Self::Context: Default, { Self::build(app).open() @@ -873,7 +876,7 @@ where context: Self::Context, ) -> Result>, OsError> where - App: AsApplication, + App: AsApplication + ?Sized, { Self::build_with(app, context).open() }