Write missing docs and Debug implementations for web
This commit is contained in:
parent
2c630809d4
commit
01b945b981
3 changed files with 22 additions and 2 deletions
|
|
@ -2,6 +2,8 @@ mod action;
|
||||||
|
|
||||||
pub use action::Action;
|
pub use action::Action;
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
|
|
||||||
|
|
@ -60,3 +62,11 @@ impl<T> Command<T> {
|
||||||
command.actions()
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ pub enum Action<T> {
|
||||||
Future(iced_futures::BoxFuture<T>),
|
Future(iced_futures::BoxFuture<T>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
impl<T> Action<T> {
|
impl<T> Action<T> {
|
||||||
/// Applies a transformation to the result of a [`Command`].
|
/// Applies a transformation to the result of a [`Command`].
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[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"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@
|
||||||
//! [`wasm-pack`]: https://github.com/rustwasm/wasm-pack
|
//! [`wasm-pack`]: https://github.com/rustwasm/wasm-pack
|
||||||
//! [`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen
|
//! [`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen
|
||||||
//! [`tour` example]: https://github.com/hecrj/iced/tree/0.3/examples/tour
|
//! [`tour` example]: https://github.com/hecrj/iced/tree/0.3/examples/tour
|
||||||
//#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
//#![deny(missing_debug_implementations)]
|
#![deny(missing_debug_implementations)]
|
||||||
#![deny(unused_results)]
|
#![deny(unused_results)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue