Skip to content

Commit

Permalink
Merge pull request #2588 from iced-rs/must-use-task
Browse files Browse the repository at this point in the history
Add `must_use` attribute to `Task`
  • Loading branch information
hecrj authored Sep 19, 2024
2 parents bf3b6f1 + 114f7df commit 3a9139e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion futures/src/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>>,
}
Expand Down
1 change: 1 addition & 0 deletions runtime/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 3a9139e

Please sign in to comment.