Merge pull request #1676 from ids1024/must_use
Annotate `Command` and `Subscription` with `#[must_use]`
This commit is contained in:
commit
818ae4977a
3 changed files with 3 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
/// A set of asynchronous actions to be performed by some runtime.
|
/// A set of asynchronous actions to be performed by some runtime.
|
||||||
|
#[must_use = "`Command` must be returned to runtime to take effect"]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Command<T>(Internal<T>);
|
pub struct Command<T>(Internal<T>);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ use crate::BoxStream;
|
||||||
/// `Hasher`.
|
/// `Hasher`.
|
||||||
///
|
///
|
||||||
/// [`Command`]: crate::Command
|
/// [`Command`]: crate::Command
|
||||||
|
#[must_use = "`Subscription` must be returned to runtime to take effect"]
|
||||||
pub struct Subscription<Hasher, Event, Output> {
|
pub struct Subscription<Hasher, Event, Output> {
|
||||||
recipes: Vec<Box<dyn Recipe<Hasher, Event, Output = Output>>>,
|
recipes: Vec<Box<dyn Recipe<Hasher, Event, Output = Output>>>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ use std::fmt;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
|
|
||||||
/// A set of asynchronous actions to be performed by some runtime.
|
/// A set of asynchronous actions to be performed by some runtime.
|
||||||
|
#[must_use = "`Command` must be returned to runtime to take effect"]
|
||||||
pub struct Command<T>(iced_futures::Command<Action<T>>);
|
pub struct Command<T>(iced_futures::Command<Action<T>>);
|
||||||
|
|
||||||
impl<T> Command<T> {
|
impl<T> Command<T> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue