summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-17 19:42:43 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-17 19:42:43 +0100
commitcab9dec6267f3e38b2dee2a0262cd04e21a7519e (patch)
treed8df566d3f6f540f75cf902931045261c7784e1a
parentcdb18e610a72b4a025d7e1890140393adee5b087 (diff)
downloadiced-cab9dec6267f3e38b2dee2a0262cd04e21a7519e.tar.gz
iced-cab9dec6267f3e38b2dee2a0262cd04e21a7519e.tar.bz2
iced-cab9dec6267f3e38b2dee2a0262cd04e21a7519e.zip
Remove `'static'` bound for `P::State` in `Program::run_with`
-rw-r--r--src/application.rs3
-rw-r--r--src/program.rs5
-rw-r--r--winit/src/application.rs5
3 files changed, 6 insertions, 7 deletions
diff --git a/src/application.rs b/src/application.rs
index 8317abcb..a44d6342 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -192,7 +192,8 @@ where
/// [`Error`]: crate::Error
fn run(settings: Settings<Self::Flags>) -> crate::Result
where
- Self: 'static,
+ Self::Message: 'static,
+ Self::Executor: 'static,
{
#[allow(clippy::needless_update)]
let renderer_settings = crate::renderer::Settings {
diff --git a/src/program.rs b/src/program.rs
index 7a366585..c423f6d0 100644
--- a/src/program.rs
+++ b/src/program.rs
@@ -166,10 +166,7 @@ impl<P: Definition> Program<P> {
/// Runs the underlying [`Application`] of the [`Program`] with a
/// closure that creates the initial state.
- pub fn run_with(
- self,
- initialize: impl Fn() -> P::State + Clone + 'static,
- ) -> Result
+ pub fn run_with(self, initialize: impl Fn() -> P::State + Clone) -> Result
where
Self: 'static,
{
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 13d9282d..ba2bd07f 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -133,7 +133,8 @@ pub async fn run<A, E, C>(
compositor_settings: C::Settings,
) -> Result<(), Error>
where
- A: Application + 'static,
+ A: Application,
+ A::Message: 'static,
E: Executor + 'static,
C: Compositor<Renderer = A::Renderer> + 'static,
A::Theme: DefaultStyle,
@@ -317,7 +318,7 @@ async fn run_instance<A, E, C>(
should_be_visible: bool,
exit_on_close_request: bool,
) where
- A: Application + 'static,
+ A: Application,
E: Executor + 'static,
C: Compositor<Renderer = A::Renderer> + 'static,
A::Theme: DefaultStyle,