From ca4218c84182690abf52d78610f7c2a555dab105 Mon Sep 17 00:00:00 2001 From: ilya Date: Sat, 18 Dec 2021 09:40:17 +0000 Subject: [PATCH] Updating state machine documentation --- little_raft/src/state_machine.rs | 7 ++++--- little_raft/src/timer.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/little_raft/src/state_machine.rs b/little_raft/src/state_machine.rs index ea8df4d..adeae67 100644 --- a/little_raft/src/state_machine.rs +++ b/little_raft/src/state_machine.rs @@ -6,7 +6,6 @@ use std::fmt::Debug; pub enum TransitionState { /// Queued transitions have been received from the user but have not been /// processed yet. They are in the queue. - /// Queued, /// Committed transitions have not yet been applied to the state machine but @@ -22,10 +21,12 @@ pub enum TransitionState { Abandoned(TransitionAbandonedReason), } +/// TransitionAbandonedReason explains why a particular transition has been +/// abandoned by the replica. #[derive(Clone, Debug, PartialEq)] pub enum TransitionAbandonedReason { - // NotLeader transitions have been abandoned because the replica is not - // the cluster leader. + /// NotLeader transitions have been abandoned because the replica is not the + /// cluster leader. NotLeader, } diff --git a/little_raft/src/timer.rs b/little_raft/src/timer.rs index 5569b09..695dd1f 100644 --- a/little_raft/src/timer.rs +++ b/little_raft/src/timer.rs @@ -32,4 +32,4 @@ impl Timer { rx } -} \ No newline at end of file +}