Skip to content

Commit

Permalink
Make raft::Driver::execute() non-async and private.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Nov 18, 2023
1 parent afb320a commit 87818b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/raft/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Driver {
pub async fn drive(mut self, mut state: Box<dyn State>) -> Result<()> {
debug!("Starting state machine driver at applied index {}", state.get_applied_index());
while let Some(instruction) = self.state_rx.next().await {
if let Err(error) = self.execute(instruction, &mut *state).await {
if let Err(error) = self.execute(instruction, &mut *state) {
error!("Halting state machine due to error: {}", error);
return Err(error);
}
Expand Down Expand Up @@ -121,7 +121,7 @@ impl Driver {
}

/// Executes a state machine instruction.
pub async fn execute(&mut self, i: Instruction, state: &mut dyn State) -> Result<()> {
fn execute(&mut self, i: Instruction, state: &mut dyn State) -> Result<()> {
debug!("Executing {:?}", i);
match i {
Instruction::Abort => {
Expand Down

0 comments on commit 87818b7

Please sign in to comment.