Skip to content

Commit

Permalink
Update the rustdoc example to match best practice
Browse files Browse the repository at this point in the history
This change updates the meta/doc example to match the best practices
outlined in RFC 1574 (already referenced by the doc). Specifically, it
removes the "Arguments" section from the `Person` doc example.

I've also added a mention of `cargo doc --open` as it's pretty useful
and people may not think to see if it exists.
  • Loading branch information
Skepfyr committed Jan 21, 2024
1 parent 0214ba6 commit 2ae29bd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/meta/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Documentation

Use `cargo doc` to build documentation in `target/doc`.
Use `cargo doc` to build documentation in `target/doc`, `cargo doc --open`
will automatically open it in your web browser.

Use `cargo test` to run all tests (including documentation tests), and `cargo
test --doc` to only run documentation tests.
Expand All @@ -23,11 +24,7 @@ pub struct Person {
}
impl Person {
/// Returns a person with the name given them
///
/// # Arguments
///
/// * `name` - A string slice that holds the name of the person
/// Creates a person with the given name.
///
/// # Examples
///
Expand Down

0 comments on commit 2ae29bd

Please sign in to comment.