diff options
-rw-r--r-- | src/application.rs | 2 | ||||
-rw-r--r-- | src/daemon.rs | 2 | ||||
-rw-r--r-- | src/program.rs | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/application.rs b/src/application.rs index c21f343a..d0f77304 100644 --- a/src/application.rs +++ b/src/application.rs @@ -169,7 +169,7 @@ impl<P: Program> Application<P> { pub fn run_with<I>(self, initialize: I) -> Result where Self: 'static, - I: Fn() -> (P::State, Task<P::Message>) + Clone + 'static, + I: FnOnce() -> (P::State, Task<P::Message>) + 'static, { self.raw .run_with(self.settings, Some(self.window), initialize) diff --git a/src/daemon.rs b/src/daemon.rs index d2de2db7..6a6ad133 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -119,7 +119,7 @@ impl<P: Program> Daemon<P> { pub fn run_with<I>(self, initialize: I) -> Result where Self: 'static, - I: Fn() -> (P::State, Task<P::Message>) + Clone + 'static, + I: FnOnce() -> (P::State, Task<P::Message>) + 'static, { self.raw.run_with(self.settings, None, initialize) } 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; |