diff --git a/src/util.rs b/src/util.rs index 80810974..3d6ae5ae 100644 --- a/src/util.rs +++ b/src/util.rs @@ -50,12 +50,9 @@ impl ThreadSpawnUnchecked for std::thread::Builder { F: FnOnce() -> R + Send, R: 'static + Send, { - let f: Box R> = Box::new(f); - // ^ No need for `'_` inside function bodies - // v but this is more readable - let _: &Box R> = &f; - // Safety: same-layout since only a lifetime difference - let f: Box R> = std::mem::transmute(f); + let f: Box R + Send> = Box::new(f); + // SAFETY: same-layout since only a lifetime difference + let f: Box R + Send> = std::mem::transmute(f); self.spawn(f) } }