Skip to content

Commit 8e53cc4

Browse files
committed
simplify the Done type
1 parent 744d0d6 commit 8e53cc4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/wasmi/src/engine/executor/handler/dispatch.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,15 @@ impl Break {
455455
}
456456

457457
pub type Control<C = (), B = Break> = ControlFlow<B, C>;
458-
pub type Done<T = NextState> = Control<T, Break>;
458+
pub type Done = Control<NextState, Break>;
459459

460460
#[cfg(feature = "portable-dispatch")]
461461
pub trait ControlContinue: Sized {
462462
fn control_continue(ip: Ip, sp: Sp, mem0: Mem0Ptr, mem0_len: Mem0Len, instance: Inst) -> Self;
463463
}
464464

465465
#[cfg(feature = "portable-dispatch")]
466-
impl ControlContinue for Done<NextState> {
466+
impl ControlContinue for Done {
467467
fn control_continue(ip: Ip, sp: Sp, mem0: Mem0Ptr, mem0_len: Mem0Len, instance: Inst) -> Self {
468468
Self::Continue(NextState {
469469
ip,
@@ -479,7 +479,7 @@ pub trait ControlBreak: Sized {
479479
fn control_break() -> Self;
480480
}
481481

482-
impl<T> ControlBreak for Done<T> {
482+
impl<T> ControlBreak for Control<T, Break> {
483483
fn control_break() -> Self {
484484
Self::Break(Break::WithReason)
485485
}
@@ -510,7 +510,7 @@ macro_rules! done {
510510
$state.done_with(move || <_ as ::core::convert::Into<
511511
$crate::engine::executor::handler::DoneReason,
512512
>>::into($reason));
513-
return <$crate::engine::executor::handler::Done<_> as $crate::engine::executor::handler::ControlBreak>::control_break();
513+
return <$crate::engine::executor::handler::Control<_, Break> as $crate::engine::executor::handler::ControlBreak>::control_break();
514514
}};
515515
}
516516

0 commit comments

Comments
 (0)