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

Refactor main loop in raft node of five node example to improve readability #549

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hhwyt
Copy link

@hhwyt hhwyt commented Sep 4, 2024

This PR two commits:

  1. Refactor main loop in raft node of five node example to improve readability
  2. Fix some compilation errors in CI.

@hhwyt hhwyt force-pushed the master branch 2 times, most recently from cd322d7 to d133b6d Compare September 5, 2024 03:02
- Adjusted the indentation in documentation comments to ensure proper formatting.
- Replaced legacy numeric constants with associated constants.
- Removed unnecessary import of legacy numeric constants.

Signed-off-by: hhwyt <[email protected]>
@hhwyt hhwyt changed the title Refactor main loop in raft node thread for better readability Refactor main loop code in raft node thread for better readability Sep 5, 2024
@hhwyt
Copy link
Author

hhwyt commented Sep 5, 2024

/cc @glorv @overvenus PTAL.

@@ -201,7 +201,7 @@ The `Ready` state contains quite a bit of information, and you need to check and
by one:

1. Check whether `messages` is empty or not. If not, it means that the node will send messages to
other nodes:
other nodes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary space?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary space?

This is a compiler error from CI, so I made this change.

CI output:

error: doc list item missing indentation
   --> src/lib.rs:204:1
    |
204 | other nodes:
    | ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
note: the lint level is defined here
   --> src/lib.rs:478:9
    |
478 | #![deny(clippy::all)]
    |         ^^^^^^^^^^^
    = note: `#[deny(clippy::doc_lazy_continuation)]` implied by `#[deny(clippy::all)]`
help: indent this line
    |
204 |    other nodes:
    | +++

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hhwyt hhwyt changed the title Refactor main loop code in raft node thread for better readability Refactor main loop in raft node of five node example to improve readability Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants