Skip to content

Commit 737dff4

Browse files
authored
task: rename generic paramter for spawn (#5993)
1 parent a6be73e commit 737dff4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tokio/src/task/spawn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ cfg_rt! {
161161
/// error[E0391]: cycle detected when processing `main`
162162
/// ```
163163
#[track_caller]
164-
pub fn spawn<T>(future: T) -> JoinHandle<T::Output>
164+
pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
165165
where
166-
T: Future + Send + 'static,
167-
T::Output: Send + 'static,
166+
F: Future + Send + 'static,
167+
F::Output: Send + 'static,
168168
{
169169
// preventing stack overflows on debug mode, by quickly sending the
170170
// task to the heap.
171-
if cfg!(debug_assertions) && std::mem::size_of::<T>() > 2048 {
171+
if cfg!(debug_assertions) && std::mem::size_of::<F>() > 2048 {
172172
spawn_inner(Box::pin(future), None)
173173
} else {
174174
spawn_inner(future, None)

0 commit comments

Comments
 (0)