mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
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:
parent
a09dd034a2
commit
527dce9a69
1 changed files with 1 additions and 0 deletions
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue