Improve try_block_on styling
@@ -120,9 +120,10 @@ impl Vmctx {
// build an std::task::Context
let mut cx = Context::from_waker(&arc_cx.waker);
- match f.as_mut().poll(&mut cx) {
- Poll::Ready(ret) => return Ok(ret),
- Poll::Pending => {
+ if let Poll::Ready(ret) = f.as_mut().poll(&mut cx) {
+ return Ok(ret);
+ }
+
// The future is pending, so we need to yield to the async executor
self.yield_impl::<AsyncYielded, AsyncResume>(AsyncYielded, false, false);
@@ -160,8 +161,6 @@ impl Vmctx {
}
}
}
- }
-}
impl InstanceHandle {
/// Run a WebAssembly function with arguments in the guest context at the given entrypoint.
