From 5c0b56278b95a16f2f0b6dedfffe730b39d52948 Mon Sep 17 00:00:00 2001 From: yanjhk <47288897+yanjhk@users.noreply.github.com> Date: Tue, 11 Jun 2019 02:23:12 +0800 Subject: [PATCH] Use ThreadPool's impl of spawn (#1139) --- tokio/src/runtime/threadpool/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/runtime/threadpool/mod.rs b/tokio/src/runtime/threadpool/mod.rs index b84edce39..4b865b4ae 100644 --- a/tokio/src/runtime/threadpool/mod.rs +++ b/tokio/src/runtime/threadpool/mod.rs @@ -234,7 +234,7 @@ impl Runtime { pub fn spawn(&mut self, future: F) -> &mut Self where F: Future + Send + 'static, { - self.inner_mut().pool.sender().spawn(future).unwrap(); + self.inner_mut().pool.spawn(future); self }