From 2ae29bdcc814767c9682e9dbcbd6d1bdc7c87a62 Mon Sep 17 00:00:00 2001 From: Jack Rickard Date: Sun, 21 Jan 2024 21:55:18 +0000 Subject: [PATCH] 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. --- src/meta/doc.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/meta/doc.md b/src/meta/doc.md index f6978a9f42..6b6f9d0603 100644 --- a/src/meta/doc.md +++ b/src/meta/doc.md @@ -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. @@ -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 ///