Skip to content

Commit 4bf0b6c

Browse files
tim-blackbirdItsDoot
authored andcommitted
Mark Task as #[must_use] (bevyengine#6068)
The `async_executor::Task` that it wraps is also `#[must_use]` with the same message. Co-authored-by: devil-ira <[email protected]>
1 parent 311f948 commit 4bf0b6c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/bevy_tasks/src/task.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::{
1414
/// Tasks that panic get immediately canceled. Awaiting a canceled task also causes a panic.
1515
/// Wraps `async_executor::Task`
1616
#[derive(Debug)]
17+
#[must_use = "Tasks are canceled when dropped, use `.detach()` to run them in the background."]
1718
pub struct Task<T>(async_executor::Task<T>);
1819

1920
impl<T> Task<T> {

0 commit comments

Comments
 (0)