summaryrefslogtreecommitdiffstats
path: root/futures/src/subscription.rs
diff options
context:
space:
mode:
authorLibravatar Ian Douglas Scott <idscott@system76.com>2023-01-26 16:10:45 -0800
committerLibravatar Ian Douglas Scott <idscott@system76.com>2023-01-26 16:10:45 -0800
commit2e4aefa7fc19e4d66152332d28baafe1349c1636 (patch)
tree787b0bbc87522e4d4cda6a3f54a5382ce7896ab6 /futures/src/subscription.rs
parent2dea5fe058f825db1a03cfce1fa84efbcb46a906 (diff)
downloadiced-2e4aefa7fc19e4d66152332d28baafe1349c1636.tar.gz
iced-2e4aefa7fc19e4d66152332d28baafe1349c1636.tar.bz2
iced-2e4aefa7fc19e4d66152332d28baafe1349c1636.zip
Annotate `Command` and `Subscription` with `#[must_use]`
Calling a function returning one of these types without using it is almost certainly a mistake. Luckily Rust's `#[must_use]` can help warn about this.
Diffstat (limited to '')
-rw-r--r--futures/src/subscription.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs
index e96fa704..d18ec4f7 100644
--- a/futures/src/subscription.rs
+++ b/futures/src/subscription.rs
@@ -20,6 +20,7 @@ use crate::BoxStream;
/// `Hasher`.
///
/// [`Command`]: crate::Command
+#[must_use = "`Subscription` must be returned to runtime to take effect"]
pub struct Subscription<Hasher, Event, Output> {
recipes: Vec<Box<dyn Recipe<Hasher, Event, Output = Output>>>,
}