Explorar el Código

Rename add() to add_command().

Jing Yang hace 5 años
padre
commit
7f1702f9d4
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      src/lib.rs
  2. 1 1
      src/log_array.rs

+ 1 - 1
src/lib.rs

@@ -841,7 +841,7 @@ where
             return None;
         }
 
-        let index = rf.log.add(term, command);
+        let index = rf.log.add_command(term, command);
         self.persister.save_state(rf.persisted_state().into());
 
         let _ = self.new_log_entry.clone().unwrap().send(None);

+ 1 - 1
src/log_array.rs

@@ -81,7 +81,7 @@ impl<C> std::ops::Index<usize> for LogArray<C> {
 
 // Mutations
 impl<C> LogArray<C> {
-    pub fn add(&mut self, term: Term, command: C) -> Index {
+    pub fn add_command(&mut self, term: Term, command: C) -> Index {
         let index = self.len();
         self.push(LogEntry {
             index,