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

Rustdoc examples #69

Merged
merged 10 commits into from
Jun 5, 2018
Merged

Rustdoc examples #69

merged 10 commits into from
Jun 5, 2018

Conversation

Hoverbear
Copy link
Contributor

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. :)

@ngaut
Copy link
Member

ngaut commented May 31, 2018

Good job.

@QueenyJin
Copy link

LGTM

@@ -25,6 +25,181 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
Copy link
Member

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)]?

Copy link
Contributor Author

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(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@hicqu
Copy link
Contributor

hicqu commented Jun 4, 2018

rest LGTM.

@hicqu
Copy link
Contributor

hicqu commented Jun 5, 2018

LGTM.

@Hoverbear Hoverbear merged commit e052b5f into master Jun 5, 2018
@Hoverbear Hoverbear added this to the 0.3.0 milestone Jul 5, 2018
@tisonkun tisonkun deleted the rustdoc-examples branch July 2, 2023 10:51
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.

6 participants