From 2d9ef9c2716acd4d49c5cef0a7b8052a0d47e506 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 31 Aug 2022 12:28:44 +0200 Subject: [PATCH 1/2] task: fix warning --- tokio/src/task/join_set.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/task/join_set.rs b/tokio/src/task/join_set.rs index 44730347408..b10b5a6b456 100644 --- a/tokio/src/task/join_set.rs +++ b/tokio/src/task/join_set.rs @@ -439,7 +439,7 @@ impl<'a, T: 'static> Builder<'a, T> { /// [`AbortHandle`]: crate::task::AbortHandle /// [runtime handle]: crate::runtime::Handle #[track_caller] - pub fn spawn_on(mut self, future: F, handle: &Handle) -> std::io::Result + pub fn spawn_on(self, future: F, handle: &Handle) -> std::io::Result where F: Future, F: Send + 'static, From 04025f6adef56adaa3ba4e09848d8a94ea6e23d4 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 31 Aug 2022 15:03:20 +0200 Subject: [PATCH 2/2] rustfmt --- tokio/src/signal/windows/sys.rs | 58 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tokio/src/signal/windows/sys.rs b/tokio/src/signal/windows/sys.rs index f2c93e66373..53090f0ab46 100644 --- a/tokio/src/signal/windows/sys.rs +++ b/tokio/src/signal/windows/sys.rs @@ -188,40 +188,40 @@ mod tests { } #[test] - fn ctrl_shutdown() { - let rt = rt(); + fn ctrl_shutdown() { + let rt = rt(); - rt.block_on(async { - let mut ctrl_shutdown = assert_ok!(crate::signal::windows::ctrl_shutdown()); + rt.block_on(async { + let mut ctrl_shutdown = assert_ok!(crate::signal::windows::ctrl_shutdown()); - // Windows doesn't have a good programmatic way of sending events - // like sending signals on Unix, so we'll stub out the actual OS - // integration and test that our handling works. - unsafe { - super::handler(wincon::CTRL_SHUTDOWN_EVENT); - } + // Windows doesn't have a good programmatic way of sending events + // like sending signals on Unix, so we'll stub out the actual OS + // integration and test that our handling works. + unsafe { + super::handler(wincon::CTRL_SHUTDOWN_EVENT); + } - ctrl_shutdown.recv().await.unwrap(); - }); - } + ctrl_shutdown.recv().await.unwrap(); + }); + } #[test] - fn ctrl_logoff() { - let rt = rt(); - - rt.block_on(async { - let mut ctrl_logoff = assert_ok!(crate::signal::windows::ctrl_logoff()); - - // Windows doesn't have a good programmatic way of sending events - // like sending signals on Unix, so we'll stub out the actual OS - // integration and test that our handling works. - unsafe { - super::handler(wincon::CTRL_LOGOFF_EVENT); - } - - ctrl_logoff.recv().await.unwrap(); - }); - } + fn ctrl_logoff() { + let rt = rt(); + + rt.block_on(async { + let mut ctrl_logoff = assert_ok!(crate::signal::windows::ctrl_logoff()); + + // Windows doesn't have a good programmatic way of sending events + // like sending signals on Unix, so we'll stub out the actual OS + // integration and test that our handling works. + unsafe { + super::handler(wincon::CTRL_LOGOFF_EVENT); + } + + ctrl_logoff.recv().await.unwrap(); + }); + } fn rt() -> Runtime { crate::runtime::Builder::new_current_thread()