This ought to be simple, but I can't get it to compile.
I have an Option, because I have a struct which may optionally own a spawned thread. I can create this easily enough, but when it comes time to join, that's not possible. Tried:
let status = self.child_thread.unwrap().join(); let status = self.child_thread.as_ref().unwrap().join(); let status = &self.child_thread.as_ref().unwrap().join();
also, boxing the JoinHandle. No good.
The problem is that JoinHandle is neither copyable nor cloneable, or here, moveable. So I can't get it out of the Option, and while inside the Option, I can't apply .join() to it.
I'm probably missing something obvious here.