55>   ;  ;   ;  ; ` ( ` ` ) ` \
66>   ;  ; | ` ( ` ( [ _ Type_ ] ` , ` )<sup >+</sup > [ _ Type_ ] <sup >?</sup > ` ) `
77
8- The * tuple type* is a structural type[ ^ 1 ] for heterogeneous lists of other
9- types. Each entry in the list is an * element* [ ^ 2 ] of the tuple. The position of
10- the element makes it the * nth element* using zero (` 0 ` ) as the initial index.
8+ The * tuple type* is a structural type[ ^ 1 ] for heterogeneous lists of other types.
9+ Each entry in the list is an * element* [ ^ 2 ] of the tuple.
10+ The position of the element makes it the * nth element* using zero (` 0 ` ) as the initial index.
1111
12- The number of elements determines the arity of the tuple. A tuple with ` n `
13- elements is called an ` n-ary tuple ` . For example, a tuple with 2 elements is a
14- 2-ary tuple.
12+ The number of elements determines the arity of the tuple.
13+ A tuple with ` n ` elements is called an ` n-ary tuple ` .
14+ For example, a tuple with 2 elements is a 2-ary tuple.
1515
16- For convenience and historical reasons, the tuple type with no elements (` () ` )
17- is often called * unit* or * the unit type* . It's one value is also called * unit*
18- or * the unit value* .
16+ For convenience and historical reasons, the tuple type with no elements (` () ` ) is often called * unit* or * the unit type* .
17+ It's one value is also called * unit* or * the unit value* .
1918
20- Tuple types are written by listing the types of their elements in a
21- parenthesized, comma-separated list. 1-ary tuples require a comma after their
22- element type to be disambiguated with a [ parenthesized type] .
19+ Tuple types are written by listing the types of their elements in a parenthesized, comma-separated list.
20+ 1-ary tuples require a comma after their element type to be disambiguated with a [ parenthesized type] .
2321
2422Some examples of tuple types:
2523
@@ -29,16 +27,14 @@ Some examples of tuple types:
2927* ` (i32, String) ` (different type from the previous example)
3028* ` (i32, f64, Vec<String>, Option<bool>) `
3129
32- Values of this type are constructed using a [ tuple expression] . Furthermore,
33- various expressions will produce the unit value if there is no other meaningful
34- value for it to evaluate to. Tuple elements can be accessed by either a [ tuple
35- index expression] or [ pattern matching] .
30+ Values of this type are constructed using a [ tuple expression] .
31+ Furthermore, various expressions will produce the unit value if there is no other meaningful value for it to evaluate to.
32+ Tuple elements can be accessed by either a [ tuple index expression] or [ pattern matching] .
3633
37- [ ^ 1 ] : Structural types are always equivalent if their internal types are
38- equivalent. For a nominal version of tuples, see [ tuple structs] .
34+ [ ^ 1 ] : Structural types are always equivalent if their internal types are equivalent.
35+ For a nominal version of tuples, see [ tuple structs] .
3936
40- [ ^ 2 ] : Element is equivalent to field, except numerical indexes instead of
41- identifiers
37+ [ ^ 2 ] : Element is equivalent to field, except numerical indexes instead of identifiers
4238
4339[ _Type_ ] : ../types.md#type-expressions
4440[ parenthesized type ] : ../types.md#parenthesized-types
0 commit comments