From f9e1d9bb406b70128f8ebe67748abbb155183d9a Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Fri, 1 Aug 2025 19:44:26 +0200 Subject: [PATCH] state_machine: remove State associated type --- core/mvcc/database/mod.rs | 2 -- core/state_machine.rs | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/core/mvcc/database/mod.rs b/core/mvcc/database/mod.rs index 7b9c60aaf..cccb713a5 100644 --- a/core/mvcc/database/mod.rs +++ b/core/mvcc/database/mod.rs @@ -305,7 +305,6 @@ impl WriteRowStateMachine { } impl StateTransition for CommitStateMachine { - type State = CommitStateMachine; type Context = MvStore; type SMResult = (); @@ -590,7 +589,6 @@ impl StateTransition for CommitStateMachine { } impl StateTransition for WriteRowStateMachine { - type State = WriteRowStateMachine; type Context = (); type SMResult = (); diff --git a/core/state_machine.rs b/core/state_machine.rs index fc8361480..0ee710ecd 100644 --- a/core/state_machine.rs +++ b/core/state_machine.rs @@ -8,7 +8,6 @@ pub enum TransitionResult { /// A generic trait for state machines. pub trait StateTransition { - type State; type Context; type SMResult; @@ -44,11 +43,10 @@ impl StateMachine { } impl StateTransition for StateMachine { - type State = State; type Context = State::Context; type SMResult = State::SMResult; - fn step(&mut self, context: &Self::Context) -> Result> { + fn step<'a>(&mut self, context: &Self::Context) -> Result> { loop { if self.is_finalized { unreachable!("StateMachine::transition: state machine is finalized");