From 0331115f9dae70d5c4194fae293d54401779b299 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Mon, 29 Aug 2022 15:45:53 +0800 Subject: [PATCH 1/2] fix incorrect signature in Task::Builder::spawn_on Signed-off-by: TennyZhuang --- tokio/src/task/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/task/builder.rs b/tokio/src/task/builder.rs index 5635c1a430a..2633600bb51 100644 --- a/tokio/src/task/builder.rs +++ b/tokio/src/task/builder.rs @@ -100,7 +100,7 @@ impl<'a> Builder<'a> { /// [`Handle::spawn`]: crate::runtime::Handle::spawn #[track_caller] pub fn spawn_on( - &mut self, + self, future: Fut, handle: &Handle, ) -> io::Result> From 6092c34cb67ddea175bbbb5ec55a9fa79dcc4911 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Tue, 30 Aug 2022 10:24:19 +0800 Subject: [PATCH 2/2] fix fmt Signed-off-by: TennyZhuang --- tokio/src/task/builder.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tokio/src/task/builder.rs b/tokio/src/task/builder.rs index 2633600bb51..c7a101b294c 100644 --- a/tokio/src/task/builder.rs +++ b/tokio/src/task/builder.rs @@ -99,11 +99,7 @@ impl<'a> Builder<'a> { /// [runtime handle]: crate::runtime::Handle /// [`Handle::spawn`]: crate::runtime::Handle::spawn #[track_caller] - pub fn spawn_on( - self, - future: Fut, - handle: &Handle, - ) -> io::Result> + pub fn spawn_on(self, future: Fut, handle: &Handle) -> io::Result> where Fut: Future + Send + 'static, Fut::Output: Send + 'static,