Skip to content

Commit

Permalink
Chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed May 1, 2024
1 parent 3023a01 commit 55cd84c
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ unused_dep:
typos:
# cargo install typos-cli
typos --write-changes openraft/ tests/ stores/memstore/ stores/rocksstore stores/sledstore examples/raft-kv-memstore/ examples/raft-kv-rocksdb/
#typos --write-changes --exclude change-log/ --exclude change-log.md --exclude derived-from-async-raft.md
# typos

clean:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ For benchmark detail, go to the [./cluster_benchmark](./cluster_benchmark) folde

-**Leader election**: by policy or manually([`trigger_elect()`][]).
-**Non-voter(learner) Role**: refer to [`add_learner()`][].
-**Log Compaction**(snapshot of state machine): by policy or manully([`trigger_snapshot()`]).
-**Log Compaction**(snapshot of state machine): by policy or manually([`trigger_snapshot()`]).
-**Snapshot replication**.
-**Dynamic Membership**: using joint membership config change. Refer to [dynamic membership](https://docs.rs/openraft/latest/openraft/docs/cluster_control/dynamic_membership/index.html)
-**Linearizable read**: [`ensure_linearizable()`][].
Expand Down
2 changes: 1 addition & 1 deletion examples/memstore/src/log_store.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Provide `LogStore`, which is a in-memory implementation of `RaftLogStore` for demostration
//! Provide `LogStore`, which is a in-memory implementation of `RaftLogStore` for demonstration
//! purpose only.

use std::collections::BTreeMap;
Expand Down
4 changes: 2 additions & 2 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use syn::Type;
/// This proc macro attribute optionally adds `Send` bounds to a trait.
///
/// By default, `Send` bounds will be added to the trait and to the return bounds of any async
/// functions defined withing the trait.
/// functions defined within the trait.
///
/// If the `singlethreaded` feature is enabled, the trait definition remains the same without any
/// added `Send` bounds.
Expand Down Expand Up @@ -161,7 +161,7 @@ fn do_since(args: TokenStream, item: TokenStream) -> Result<TokenStream, syn::Er

/// Render a template with arguments multiple times.
///
/// The template to expand is defined as `(K,V) => { ... }`, where `K` and `V` are tempalte
/// The template to expand is defined as `(K,V) => { ... }`, where `K` and `V` are template
/// variables.
///
/// - The template must contain at least 1 variable.
Expand Down
2 changes: 1 addition & 1 deletion macros/tests/since/expand/with_doc.expanded.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Doc
///
/// By default, `Send` bounds will be added to the trait and to the return bounds of any async
/// functions defined withing the trait.
/// functions defined within the trait.
///
/// If the `singlethreaded` feature is enabled, the trait definition remains the same without any
/// added `Send` bounds.
Expand Down
2 changes: 1 addition & 1 deletion macros/tests/since/expand/with_doc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Doc
///
/// By default, `Send` bounds will be added to the trait and to the return bounds of any async
/// functions defined withing the trait.
/// functions defined within the trait.
///
/// If the `singlethreaded` feature is enabled, the trait definition remains the same without any
/// added `Send` bounds.
Expand Down
4 changes: 2 additions & 2 deletions openraft/src/docs/faq/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Openraft stores committed log id: See: [`RaftLogStorage::save_committed()`][];
- Openraft optimized `ReadIndex`: no `blank log` check: [`Linearizable Read`][].
- A restarted Leader will stay in Leader state if possible;
- Does not support single step memebership change. Only joint is supported.
- Does not support single step membership change. Only joint is supported.


## Observation and Management
Expand Down Expand Up @@ -78,7 +78,7 @@ There are two ways to initialize a raft cluster, assuming there are three nodes,
all 3 nodes, e.g. `n2.initialize(btreeset! {1,2,3})`.

2. Incremental method:
First, call `Raft::initialize()` on `n1` with configuraion containing `n1`
First, call `Raft::initialize()` on `n1` with configuration containing `n1`
itself, e.g., `n1.initialize(btreeset! {1})`.
Subsequently use `Raft::change_membership()` on `n1` to add `n2` and `n3`
into the cluster.
Expand Down
2 changes: 1 addition & 1 deletion openraft/src/docs/upgrade_guide/upgrade-v08-v09.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Follow the following steps to update your application to pass compilation with v
- `RaftNetwork::send_vote()` to `RaftNetwork::vote()`;
- `RaftNetwork::send_install_snapshot()` to `RaftNetwork::install_snapshot()`;

- `asycn` traits in Openraft are declared with [`#[openraft-macros::add_async_trait]`][`openraft-macros`] attribute since 0.9.
- `async` traits in Openraft are declared with [`#[openraft-macros::add_async_trait]`][`openraft-macros`] attribute since 0.9.
`#[async_trait::async_trait]` are no longer needed when implementing `async` trait.

For example, upgrade 0.8 async-trait implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn test_leader_append_membership_for_leader() -> anyhow::Result<()> {

#[test]
fn test_leader_append_membership_update_learner_process() -> anyhow::Result<()> {
// When updating membership, voter progreess should inherit from learner progress, and
// When updating membership, voter progress should inherit from learner progress, and
// learner process should inherit from voter process. If voter changes to
// learner or vice versa.

Expand Down
2 changes: 1 addition & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Build change log since a previous git-tag
- Usage: `./scripts/build_change_log.py <commit>`: build since specified commit.
- Install: `pip install -r requirements.txt`.

This script buils change log from git commit messages, outputs a versioned
This script builds change log from git commit messages, outputs a versioned
change log to `./change-log/<version>.md` and concatenates all versioned change log
into `./change-log.md`.

Expand Down
6 changes: 3 additions & 3 deletions scripts/build_change_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ def build_ver_changelog_summary(ver):

# Remove existent summary
try:
footer_indexs = lines.index(footer)
footer_indexes = lines.index(footer)
except ValueError as e:
print("No footer found")
else:
# skip `Detail:`, and a following blank line.
lines = lines[footer_indexs+2:]
lines = lines[footer_indexes+2:]

# Build summary:
# - Remove lines that starts with space, which is detail section, a list item
Expand Down Expand Up @@ -344,7 +344,7 @@ def build_ver_changelog_summary(ver):
# Remove suffix author
l = re.sub('; by .*?$', '.', l)

# Remove redundent "."
# Remove redundant "."
l = re.sub('[.][.]$', '.', l)

# add indent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async fn new_leader_auto_commit_uniform_config() -> Result<()> {

let _ = log_index;

// To let tne router not panic
// To let the router not panic
router.new_raft_node(1).await;
router.new_raft_node(2).await;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async fn append_entries_partial_success() -> Result<()> {

tracing::info!(
log_index,
"--- set append-entries quota to {}, wirte {} entries",
"--- set append-entries quota to {}, write {} entries",
quota,
n
);
Expand Down

0 comments on commit 55cd84c

Please sign in to comment.