Skip to content

Commit 2ae29bd

Browse files
committed
Update the rustdoc example to match best practice
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.
1 parent 0214ba6 commit 2ae29bd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/meta/doc.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Documentation
22

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

56
Use `cargo test` to run all tests (including documentation tests), and `cargo
67
test --doc` to only run documentation tests.
@@ -23,11 +24,7 @@ pub struct Person {
2324
}
2425
2526
impl Person {
26-
/// Returns a person with the name given them
27-
///
28-
/// # Arguments
29-
///
30-
/// * `name` - A string slice that holds the name of the person
27+
/// Creates a person with the given name.
3128
///
3229
/// # Examples
3330
///

0 commit comments

Comments
 (0)