fix: toaster behind feature gate

This commit is contained in:
Ashley Wulber 2024-07-05 14:08:07 -04:00
parent 4da66f8cc0
commit a5b6398e84
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
3 changed files with 5 additions and 6 deletions

2
iced

@ -1 +1 @@
Subproject commit 4c609e776a7721bddb6d50b60096f4d1f655491c Subproject commit 6f83a8d16447b2590cb081f3e0f294678cc6caaf

View file

@ -350,4 +350,5 @@ pub mod warning;
#[doc(inline)] #[doc(inline)]
pub use warning::*; pub use warning::*;
#[cfg(any(feature = "winit", feature = "wayland"))]
pub mod toaster; pub mod toaster;

View file

@ -144,10 +144,7 @@ pub struct ToastMessage(u32);
impl<Message> Toasts<Message> { impl<Message> Toasts<Message> {
/// Add a new [`Toast`] /// Add a new [`Toast`]
pub fn push( pub fn push(&mut self, mut toast: Toast<Message>) -> Command<Message>
&mut self,
mut toast: Toast<Message>,
) -> Command<Message>
where where
Message: From<ToastMessage>, Message: From<ToastMessage>,
{ {
@ -164,6 +161,7 @@ impl<Message> Toasts<Message> {
self.toasts.push_back(toast); self.toasts.push_back(toast);
crate::command::future(async move { crate::command::future(async move {
#[cfg(feature = "tokio")]
tokio::time::sleep(duration).await; tokio::time::sleep(duration).await;
crate::app::Message::App(Message::from(message)) crate::app::Message::App(Message::from(message))
}) })