mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 21:31:17 -06:00
@@ -457,12 +457,12 @@ has two primitive compound types: tuples and arrays.
|
|||||||
#### Grouping Values into Tuples
|
#### Grouping Values into Tuples
|
||||||
|
|
||||||
A tuple is a general way of grouping together some number of other values with
|
A tuple is a general way of grouping together some number of other values with
|
||||||
distinct types into one compound type.
|
a variety of types into one compound type.
|
||||||
|
|
||||||
We create a tuple by writing a comma-separated list of values inside
|
We create a tuple by writing a comma-separated list of values inside
|
||||||
parentheses. Each position in the tuple has a distinct type, and the types of
|
parentheses. Each position in the tuple has a type, and the types of the
|
||||||
the different values in the tuple do not have to be the same. We’ve added
|
different values in the tuple don’t have to be the same. We’ve added optional
|
||||||
optional type annotations in this example:
|
type annotations in this example:
|
||||||
|
|
||||||
Filename: src/main.rs
|
Filename: src/main.rs
|
||||||
|
|
||||||
|
|||||||
@@ -208,12 +208,12 @@ has two primitive compound types: tuples and arrays.
|
|||||||
#### Grouping Values into Tuples
|
#### Grouping Values into Tuples
|
||||||
|
|
||||||
A tuple is a general way of grouping together some number of other values with
|
A tuple is a general way of grouping together some number of other values with
|
||||||
distinct types into one compound type.
|
a variety of types into one compound type.
|
||||||
|
|
||||||
We create a tuple by writing a comma-separated list of values inside
|
We create a tuple by writing a comma-separated list of values inside
|
||||||
parentheses. Each position in the tuple has a distinct type, and the types of
|
parentheses. Each position in the tuple has a type, and the types of the
|
||||||
the different values in the tuple do not have to be the same. We’ve added
|
different values in the tuple don’t have to be the same. We’ve added optional
|
||||||
optional type annotations in this example:
|
type annotations in this example:
|
||||||
|
|
||||||
Filename: src/main.rs
|
Filename: src/main.rs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user