From eb67aa5d71172569e3d404107a1a449998d98d42 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 17 Mar 2024 19:53:02 +0100 Subject: Revert "Remove `'static'` bound for `P::State` in `Program::run_with`" This reverts commit cab9dec6267f3e38b2dee2a0262cd04e21a7519e. Wasm needs the `'static'` bound since the runtime will run in a background task. --- src/application.rs | 3 +-- src/program.rs | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/application.rs b/src/application.rs index a44d6342..8317abcb 100644 --- a/src/application.rs +++ b/src/application.rs @@ -192,8 +192,7 @@ where /// [`Error`]: crate::Error fn run(settings: Settings) -> crate::Result where - Self::Message: 'static, - Self::Executor: 'static, + Self: 'static, { #[allow(clippy::needless_update)] let renderer_settings = crate::renderer::Settings { diff --git a/src/program.rs b/src/program.rs index c423f6d0..7a366585 100644 --- a/src/program.rs +++ b/src/program.rs @@ -166,7 +166,10 @@ impl Program

{ /// 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) -> Result + pub fn run_with( + self, + initialize: impl Fn() -> P::State + Clone + 'static, + ) -> Result where Self: 'static, { -- cgit