diff --git a/melib/src/async.rs b/melib/src/async.rs index 627ed6bd..0235d93f 100644 --- a/melib/src/async.rs +++ b/melib/src/async.rs @@ -125,4 +125,8 @@ impl Async { self.value = Some(v); Ok(AsyncStatus::Finished) } + /// Blocks until thread joins. + pub fn join(mut self) -> T { + self.worker.take().unwrap().join().unwrap() + } }