-
Notifications
You must be signed in to change notification settings - Fork 399
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
Rustdoc examples #69
Rustdoc examples #69
Conversation
Add some short exerpts from the `mem_node` example to "Step 3: Process the Ready State".
Good job. |
LGTM |
@@ -25,6 +25,181 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
/*! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a #[deny(missing_docs)]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to do that eventually but right now that would make the build fail until we added quite some documentation. I opened #72 to track this.
network.send(vec![ | ||
new_message(campaigner_id, campaigner_id, MessageType::MsgHup, 0), | ||
]); | ||
network.send(vec![new_message( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the format is changed? With rustfmt
required in TiKV:
$ rustfmt -V
rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
It format code in old style. I think we can follow that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raft uses stable rustfmt
, not nightly.
rest LGTM. |
LGTM. |
Supersedes #65.
Motivation
We're having lots of people who want to use Raft, but they don't know how! @queenypingcap did a great job assembling some examples and writing around how to use the crate, however it made the README very long.
This PR moves that content (with minor refactoring) into the Rust API docs generated by https://docs.rs/raft/ and
cargo doc
.Further Work
There should be a follow up in the future that makes all examples fully tested, but for now this is a big enough step forward. :)