Revert "Remove 'static' bound for P::State in Program::run_with"
This reverts commit cab9dec626.
Wasm needs the `'static'` bound since the runtime
will run in a background task.
This commit is contained in:
parent
cab9dec626
commit
eb67aa5d71
3 changed files with 7 additions and 6 deletions
|
|
@ -192,8 +192,7 @@ where
|
||||||
/// [`Error`]: crate::Error
|
/// [`Error`]: crate::Error
|
||||||
fn run(settings: Settings<Self::Flags>) -> crate::Result
|
fn run(settings: Settings<Self::Flags>) -> crate::Result
|
||||||
where
|
where
|
||||||
Self::Message: 'static,
|
Self: 'static,
|
||||||
Self::Executor: 'static,
|
|
||||||
{
|
{
|
||||||
#[allow(clippy::needless_update)]
|
#[allow(clippy::needless_update)]
|
||||||
let renderer_settings = crate::renderer::Settings {
|
let renderer_settings = crate::renderer::Settings {
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,10 @@ impl<P: Definition> Program<P> {
|
||||||
|
|
||||||
/// Runs the underlying [`Application`] of the [`Program`] with a
|
/// Runs the underlying [`Application`] of the [`Program`] with a
|
||||||
/// closure that creates the initial state.
|
/// 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
|
where
|
||||||
Self: 'static,
|
Self: 'static,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,7 @@ pub async fn run<A, E, C>(
|
||||||
compositor_settings: C::Settings,
|
compositor_settings: C::Settings,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>
|
||||||
where
|
where
|
||||||
A: Application,
|
A: Application + 'static,
|
||||||
A::Message: 'static,
|
|
||||||
E: Executor + 'static,
|
E: Executor + 'static,
|
||||||
C: Compositor<Renderer = A::Renderer> + 'static,
|
C: Compositor<Renderer = A::Renderer> + 'static,
|
||||||
A::Theme: DefaultStyle,
|
A::Theme: DefaultStyle,
|
||||||
|
|
@ -318,7 +317,7 @@ async fn run_instance<A, E, C>(
|
||||||
should_be_visible: bool,
|
should_be_visible: bool,
|
||||||
exit_on_close_request: bool,
|
exit_on_close_request: bool,
|
||||||
) where
|
) where
|
||||||
A: Application,
|
A: Application + 'static,
|
||||||
E: Executor + 'static,
|
E: Executor + 'static,
|
||||||
C: Compositor<Renderer = A::Renderer> + 'static,
|
C: Compositor<Renderer = A::Renderer> + 'static,
|
||||||
A::Theme: DefaultStyle,
|
A::Theme: DefaultStyle,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue