Skip to content

Commit

Permalink
Remove unnecessary unit argument
Browse files Browse the repository at this point in the history
  • Loading branch information
komamitsu committed Aug 15, 2023
1 parent c2cb0cf commit 6815165
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/candidate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ let next_mode t =
CANDIDATE


let run ~conf ~apply_log ~state () =
let run ~conf ~apply_log ~state =
init ~conf ~apply_log ~state >>= fun t ->
VolatileState.reset_leader_id t.state.volatile_state ~logger:t.logger;
let persistent_state = t.state.persistent_state in
Expand Down
1 change: 0 additions & 1 deletion lib/candidate.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ val run :
conf:Conf.t ->
apply_log:Base.apply_log ->
state:State.common ->
unit ->
(Base.mode Lwt.t, string) result
2 changes: 1 addition & 1 deletion lib/follower.ml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ let request_handlers t ~election_timer =
handlers


let run ~conf ~apply_log ~state () =
let run ~conf ~apply_log ~state =
init ~conf ~apply_log ~state >>= fun t ->
VolatileState.reset_leader_id t.state.volatile_state ~logger:t.logger;
PersistentState.set_voted_for t.state.persistent_state ~logger:t.logger
Expand Down
1 change: 0 additions & 1 deletion lib/follower.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ val run :
conf:Conf.t ->
apply_log:Base.apply_log ->
state:State.common ->
unit ->
(Base.mode Lwt.t, string) result
2 changes: 1 addition & 1 deletion lib/leader.ml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ let request_handlers t =
handlers


let run ~conf ~apply_log ~state () =
let run ~conf ~apply_log ~state =
init ~conf ~apply_log ~state >>= fun t ->
VolatileState.update_leader_id t.state.common.volatile_state ~logger:t.logger
t.conf.node_id;
Expand Down
1 change: 0 additions & 1 deletion lib/leader.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ val run :
conf:Conf.t ->
apply_log:Base.apply_log ->
state:State.common ->
unit ->
(Base.mode Lwt.t, string) result
6 changes: 3 additions & 3 deletions lib/oraft.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ let process ~conf ~logger ~apply_log ~state : unit Lwt.t =
let exec next_mode =
VolatileState.update_mode state.volatile_state ~logger next_mode;
match next_mode with
| FOLLOWER -> Follower.run ~conf ~apply_log ~state ()
| CANDIDATE -> Candidate.run ~conf ~apply_log ~state ()
| LEADER -> Leader.run ~conf ~apply_log ~state ()
| FOLLOWER -> Follower.run ~conf ~apply_log ~state
| CANDIDATE -> Candidate.run ~conf ~apply_log ~state
| LEADER -> Leader.run ~conf ~apply_log ~state
in
let rec loop next_mode =
match exec next_mode with
Expand Down

0 comments on commit 6815165

Please sign in to comment.