Skip to content

Commit

Permalink
Mark Task as #[must_use] (bevyengine#6068)
Browse files Browse the repository at this point in the history
The `async_executor::Task` that it wraps is also `#[must_use]` with the same message.

Co-authored-by: devil-ira <[email protected]>
  • Loading branch information
2 people authored and james7132 committed Oct 19, 2022
1 parent 933a3bc commit 1efdb34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_tasks/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 1efdb34

Please sign in to comment.