diff --git a/src/runner.rs b/src/runner.rs index bd0d245..d5cff69 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -32,11 +32,7 @@ impl SubsystemRunner { Fut: 'static + Future> + Send, Err: Into, { - let future = { - let name = Arc::clone(&name); - async move { run_subsystem(name, subsystem, subsystem_handle, guard).await } - }; - + let future = async { run_subsystem(name, subsystem, subsystem_handle, guard).await }; let aborthandle = crate::spawn(future, "subsystem_runner").abort_handle(); SubsystemRunner { aborthandle } } @@ -61,7 +57,6 @@ async fn run_subsystem( let mut redirected_subsystem_handle = subsystem_handle.delayed_clone(); let future = async { subsystem(subsystem_handle).await.map_err(|e| e.into()) }; - let join_handle = crate::spawn(future, &name); // Abort on drop