From 114f7dfa14530a0197125dfef36d2a385bff5c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 19 Sep 2024 23:17:09 +0200 Subject: [PATCH] Add `must_use` attribute to `Task` --- futures/src/subscription.rs | 2 +- runtime/src/task.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs index 8067c25906..eaea1a1fd6 100644 --- a/futures/src/subscription.rs +++ b/futures/src/subscription.rs @@ -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 { recipes: Vec>>, } diff --git a/runtime/src/task.rs b/runtime/src/task.rs index ec8d7cc769..3f97d134bc 100644 --- a/runtime/src/task.rs +++ b/runtime/src/task.rs @@ -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(Option>>); impl Task {