diff options
author | 2024-07-15 13:34:22 +0200 | |
---|---|---|
committer | 2024-07-15 13:34:22 +0200 | |
commit | bdf0430880f5c29443f5f0a0ae4895866dfef4c6 (patch) | |
tree | 46a176e7b4e6828fdd1158932e05d547028edc61 /src/program.rs | |
parent | 950bfc07d4b71016bf3e9d53709395e185420cec (diff) | |
download | iced-bdf0430880f5c29443f5f0a0ae4895866dfef4c6.tar.gz iced-bdf0430880f5c29443f5f0a0ae4895866dfef4c6.tar.bz2 iced-bdf0430880f5c29443f5f0a0ae4895866dfef4c6.zip |
Make `run_with` take a `FnOnce`
Diffstat (limited to '')
-rw-r--r-- | src/program.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/program.rs b/src/program.rs index 939b0047..2b697fbe 100644 --- a/src/program.rs +++ b/src/program.rs @@ -92,7 +92,7 @@ pub trait Program: Sized { ) -> Result where Self: 'static, - I: Fn() -> (Self::State, Task<Self::Message>) + Clone + 'static, + I: FnOnce() -> (Self::State, Task<Self::Message>) + 'static, { use std::marker::PhantomData; @@ -102,8 +102,8 @@ pub trait Program: Sized { _initialize: PhantomData<I>, } - impl<P: Program, I: Fn() -> (P::State, Task<P::Message>)> shell::Program - for Instance<P, I> + impl<P: Program, I: FnOnce() -> (P::State, Task<P::Message>)> + shell::Program for Instance<P, I> { type Message = P::Message; type Theme = P::Theme; |