Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yg-i opened this issue Jun 15, 2024 · 0 comments · Fixed by #1514
Closed

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

yg-i opened this issue Jun 15, 2024 · 0 comments · Fixed by #1514

Comments

@yg-i
Copy link

yg-i commented Jun 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant