Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in code comments #545

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading