Skip to content

Documentation example contains non-standard Arguments section #1457

Closed
@Skepfyr

Description

@Skepfyr

The documentation example is src/meta/doc.md on Person::new looks like:

    /// Returns a person with the name given them
    ///
    /// # Arguments
    ///
    /// * `name` - A string slice that holds the name of the person
    ///
    /// # Examples
    ///
    /// ```
    /// // You can have rust code between fences inside the comments
    /// // If you pass --test to `rustdoc`, it will even test it for you!
    /// use doc::Person;
    /// let person = Person::new("name");
    /// ```

As far as I am aware the Arguments section is non-standard (and recommended against?), I've definitely never seen it in the standard library or any of the most popular crates. I think it could just be removed, maybe even replaced by an example with the headings suggested by RFC 1574: Examples, Panics, Errors, Safety, Aborts, Undefined Behavior. (Maybe not all at once!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions