Skip to content

Commit

Permalink
Fix typos in code comments (#545)
Browse files Browse the repository at this point in the history
Signed-off-by: Bisheng Huang <[email protected]>
  • Loading branch information
hbisheng authored May 15, 2024
1 parent 1ccd1f3 commit 2aefbf6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/five_mem_node/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn main() {
&logger,
);

// Check control signals from
// Check control signals from the main thread.
if check_signals(&rx_stop_clone) {
return;
};
Expand Down
4 changes: 2 additions & 2 deletions src/raw_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl<T: Storage> RawNode<T> {
self.raft.step(m)
}

/// Propose proposes data be appended to the raft log.
/// Propose proposes data to be appended to the raft log.
pub fn propose(&mut self, context: Vec<u8>, data: Vec<u8>) -> Result<()> {
let mut m = Message::default();
m.set_msg_type(MessageType::MsgPropose);
Expand Down Expand Up @@ -647,7 +647,7 @@ impl<T: Storage> RawNode<T> {
/// committed entries, send all messages.
///
/// Returns the LightReady that contains commit index, committed entries and messages. [`LightReady`]
/// contains updates that only valid after persisting last ready. It should also be fully processed.
/// contains updates that are only valid after persisting last ready. It should also be fully processed.
/// Then [`Self::advance_apply`] or [`Self::advance_apply_to`] should be used later to update applying
/// progress.
pub fn advance(&mut self, rd: Ready) -> LightReady {
Expand Down
4 changes: 2 additions & 2 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub trait Storage {
/// If snapshot is temporarily unavailable, it should return SnapshotTemporarilyUnavailable,
/// so raft state machine could know that Storage needs some time to prepare
/// snapshot and call snapshot later.
/// A snapshot's index must not less than the `request_index`.
/// A snapshot's index must not be less than the `request_index`.
/// `to` indicates which peer is requesting the snapshot.
fn snapshot(&self, request_index: u64, to: u64) -> Result<Snapshot>;
}
Expand Down Expand Up @@ -373,7 +373,7 @@ impl MemStorageCore {
/// `MemStorage` is a thread-safe but incomplete implementation of `Storage`, mainly for tests.
///
/// A real `Storage` should save both raft logs and applied data. However `MemStorage` only
/// contains raft logs. So you can call `MemStorage::append` to persist new received unstable raft
/// contains raft logs. So you can call `MemStorage::append` to persist newly received unstable raft
/// logs and then access them with `Storage` APIs. The only exception is `Storage::snapshot`. There
/// is no data in `Snapshot` returned by `MemStorage::snapshot` because applied data is not stored
/// in `MemStorage`.
Expand Down

0 comments on commit 2aefbf6

Please sign in to comment.