Merge 'state_machine: remove State associated type' from Pere Diaz Bou

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2395
This commit is contained in:
Jussi Saurio
2025-08-02 09:36:43 +03:00
committed by GitHub
2 changed files with 1 additions and 5 deletions

View File

@@ -305,7 +305,6 @@ impl WriteRowStateMachine {
}
impl<Clock: LogicalClock> StateTransition for CommitStateMachine<Clock> {
type State = CommitStateMachine<Clock>;
type Context = MvStore<Clock>;
type SMResult = ();
@@ -590,7 +589,6 @@ impl<Clock: LogicalClock> StateTransition for CommitStateMachine<Clock> {
}
impl StateTransition for WriteRowStateMachine {
type State = WriteRowStateMachine;
type Context = ();
type SMResult = ();

View File

@@ -8,7 +8,6 @@ pub enum TransitionResult<Result> {
/// A generic trait for state machines.
pub trait StateTransition {
type State;
type Context;
type SMResult;
@@ -44,11 +43,10 @@ impl<State: StateTransition> StateMachine<State> {
}
impl<State: StateTransition> StateTransition for StateMachine<State> {
type State = State;
type Context = State::Context;
type SMResult = State::SMResult;
fn step(&mut self, context: &Self::Context) -> Result<TransitionResult<Self::SMResult>> {
fn step<'a>(&mut self, context: &Self::Context) -> Result<TransitionResult<Self::SMResult>> {
loop {
if self.is_finalized {
unreachable!("StateMachine::transition: state machine is finalized");