Add must_use attribute to Task

This commit is contained in:
Héctor Ramón Jiménez 2024-09-19 23:17:09 +02:00
parent bf3b6f100d
commit 114f7dfa14
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 2 additions and 1 deletions

View file

@ -113,7 +113,7 @@ pub type Hasher = rustc_hash::FxHasher;
/// ```
///
/// [`Future`]: std::future::Future
#[must_use = "`Subscription` must be returned to runtime to take effect"]
#[must_use = "`Subscription` must be returned to the runtime to take effect; normally in your `subscription` function."]
pub struct Subscription<T> {
recipes: Vec<Box<dyn Recipe<Output = T>>>,
}

View file

@ -14,6 +14,7 @@ use std::future::Future;
///
/// A [`Task`] _may_ produce a bunch of values of type `T`.
#[allow(missing_debug_implementations)]
#[must_use = "`Task` must be returned to the runtime to take effect; normally in your `update` or `new` functions."]
pub struct Task<T>(Option<BoxStream<Action<T>>>);
impl<T> Task<T> {