Explorar o código

Add comment to explain the verify authority API.

Jing Yang %!s(int64=3) %!d(string=hai) anos
pai
achega
98f001201f
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/verify_authority.rs

+ 3 - 0
src/verify_authority.rs

@@ -418,6 +418,9 @@ impl<Command: 'static + Send> Raft<Command> {
         let (term, commit_index) = {
             let rf = self.inner_state.lock();
             if !rf.is_leader() {
+                // Returning none instead of `Pending::Ready(TermElapsed)`,
+                // because that requires a separate struct that implements
+                // Future, which is tedious to write.
                 return None;
             }