Mark Task as #[must_use] (#6068)

The `async_executor::Task` that it wraps is also `#[must_use]` with the same message.

Co-authored-by: devil-ira <justthecooldude@gmail.com>
This commit is contained in:
ira 2022-09-22 17:21:16 +00:00
parent a09dd034a2
commit 527dce9a69

View file

@ -14,6 +14,7 @@ use std::{
/// Tasks that panic get immediately canceled. Awaiting a canceled task also causes a panic.
/// Wraps `async_executor::Task`
#[derive(Debug)]
#[must_use = "Tasks are canceled when dropped, use `.detach()` to run them in the background."]
pub struct Task<T>(async_executor::Task<T>);
impl<T> Task<T> {