Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc warning in bevy_tasks #9348

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions crates/bevy_tasks/src/single_threaded_task_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ thread_local! {
static LOCAL_EXECUTOR: async_executor::LocalExecutor<'static> = async_executor::LocalExecutor::new();
}

/// Used to create a TaskPool
/// Used to create a [`TaskPool`].
#[derive(Debug, Default, Clone)]
pub struct TaskPoolBuilder {}

Expand All @@ -24,7 +24,7 @@ impl<'a> ThreadExecutor<'a> {
}

impl TaskPoolBuilder {
/// Creates a new TaskPoolBuilder instance
/// Creates a new `TaskPoolBuilder` instance
pub fn new() -> Self {
Self::default()
}
Expand Down Expand Up @@ -76,7 +76,7 @@ impl TaskPool {
1
}

/// Allows spawning non-'static futures on the thread pool. The function takes a callback,
/// Allows spawning non-`'static` futures on the thread pool. The function takes a callback,
/// passing a scope object into it. The scope object provided to the callback can be used
/// to spawn tasks. This function will await the completion of all tasks before returning.
///
Expand All @@ -89,7 +89,7 @@ impl TaskPool {
self.scope_with_executor(false, None, f)
}

/// Allows spawning non-`static futures on the thread pool. The function takes a callback,
/// Allows spawning non-`'static` futures on the thread pool. The function takes a callback,
/// passing a scope object into it. The scope object provided to the callback can be used
/// to spawn tasks. This function will await the completion of all tasks before returning.
///
Expand Down Expand Up @@ -240,7 +240,8 @@ impl<'scope, 'env, T: Send + 'env> Scope<'scope, 'env, T> {
let result = Rc::new(RefCell::new(None));
self.results.borrow_mut().push(result.clone());
let f = async move {
result.borrow_mut().replace(f.await);
let temp_result = f.await;
result.borrow_mut().replace(temp_result);
};
self.executor.spawn(f).detach();
}
Expand Down