diff --git a/components/util/task.rs b/components/util/task.rs index 0da712f5d06..2495bb8acd5 100644 --- a/components/util/task.rs +++ b/components/util/task.rs @@ -12,9 +12,7 @@ pub fn spawn_named(name: String, f: F) where F: FnOnce() + Send + 'static { let builder = thread::Builder::new().name(name); - builder.spawn(move || { - f() - }).unwrap(); + builder.spawn(f).unwrap(); } /// Arrange to send a particular message to a channel if the task fails.