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 <justthecooldude@gmail.com>
  • Loading branch information
2 people authored and ItsDoot committed Feb 1, 2023
1 parent 311f948 commit 4bf0b6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_tasks/src/task.rs
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 4bf0b6c

Please sign in to comment.