瀏覽代碼

Update a few comments so that they are more relevant.

Jing Yang 5 年之前
父節點
當前提交
2a3d79a1c3
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/lib.rs

+ 2 - 4
src/lib.rs

@@ -431,15 +431,13 @@ impl Raft {
         let mut votes = vec![];
         for (index, rpc_client) in self.peers.iter().enumerate() {
             if index != self.me.0 {
-                // RpcClient must be cloned to avoid sending its reference
-                // across threads.
+                // RpcClient must be cloned so that it lives long enough for
+                // spawn(), which requires static life time.
                 let rpc_client = rpc_client.clone();
                 // RPCs are started right away.
                 let one_vote = self
                     .thread_pool
                     .spawn(Self::request_vote(rpc_client, args.clone()));
-                // Futures must be pinned so that they have Unpin, as required
-                // by futures::future::select.
                 votes.push(one_vote);
             }
         }