Skip to content

suggestion: add an example of a 1-ary tuple type in section 10.1.5 #1511

@yg-i

Description

@yg-i

Here's the current list of examples in section 10.1.5 (https://doc.rust-lang.org/reference/types/tuple.html):

Some examples of tuple types:

() (unit)
(f64, f64)
(String, i32)
(i32, String) (different type from the previous example)
(i32, f64, Vec, Option)

Curiously, there's no example of a 1-ary tuple type. I suggest adding one to the list, like this:

(i32,)

This would make the list more complete and consistent, and would also help to illustrate the obligatory comma, not just in the tuple expressions for 1-ary tuple values, but also in the type expressions for 1-ary tuple types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions