diff options
Diffstat (limited to '')
-rw-r--r-- | web/src/command.rs | 10 | ||||
-rw-r--r-- | web/src/command/action.rs | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/web/src/command.rs b/web/src/command.rs index f222795d..33e49e70 100644 --- a/web/src/command.rs +++ b/web/src/command.rs @@ -2,6 +2,8 @@ mod action; pub use action::Action; +use std::fmt; + #[cfg(target_arch = "wasm32")] use std::future::Future; @@ -60,3 +62,11 @@ impl<T> Command<T> { command.actions() } } + +impl<T> fmt::Debug for Command<T> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Command(command) = self; + + command.fmt(f) + } +} diff --git a/web/src/command/action.rs b/web/src/command/action.rs index cf384f07..c0223e50 100644 --- a/web/src/command/action.rs +++ b/web/src/command/action.rs @@ -2,6 +2,8 @@ pub enum Action<T> { Future(iced_futures::BoxFuture<T>), } +use std::fmt; + impl<T> Action<T> { /// Applies a transformation to the result of a [`Command`]. #[cfg(target_arch = "wasm32")] @@ -16,3 +18,11 @@ impl<T> Action<T> { } } } + +impl<T> fmt::Debug for Action<T> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Future(_) => write!(f, "Action::Future"), + } + } +} |