diff options
-rw-r--r-- | runtime/src/task.rs | 5 | ||||
-rw-r--r-- | src/application.rs | 10 | ||||
-rw-r--r-- | src/lib.rs | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/runtime/src/task.rs b/runtime/src/task.rs index 72f408e0..4d75ddaa 100644 --- a/runtime/src/task.rs +++ b/runtime/src/task.rs @@ -283,10 +283,7 @@ impl<T, E> Task<Result<T, E>> { } } -impl<T> From<()> for Task<T> -where - T: MaybeSend + 'static, -{ +impl<T> From<()> for Task<T> { fn from(_value: ()) -> Self { Self::none() } diff --git a/src/application.rs b/src/application.rs index f5e06471..71cb6a7f 100644 --- a/src/application.rs +++ b/src/application.rs @@ -417,6 +417,16 @@ pub trait Update<State, Message> { ) -> impl Into<Task<Message>>; } +impl<State, Message> Update<State, Message> for () { + fn update( + &self, + _state: &mut State, + _message: Message, + ) -> impl Into<Task<Message>> { + () + } +} + impl<T, State, Message, C> Update<State, Message> for T where T: Fn(&mut State, Message) -> C, @@ -345,8 +345,6 @@ pub type Result = std::result::Result<(), Error>; /// /// This is equivalent to chaining [`application()`] with [`Application::run`]. /// -/// [`program`]: program() -/// /// # Example /// ```no_run /// use iced::widget::{button, column, text, Column}; |