@@ -6,7 +6,7 @@ strings, but next, let's talk about some more complicated ways of storing data.
66
77## Tuples
88
9- The first compound data type we're going to talk about are called ** tuple ** s .
9+ The first compound data type we're going to talk about are called * tuples * .
1010Tuples are an ordered list of a fixed size. Like this:
1111
1212``` rust
@@ -25,10 +25,10 @@ position having a type name rather than the value. Careful readers will also
2525note that tuples are heterogeneous: we have an ` i32 ` and a ` &str ` in this tuple.
2626You haven't seen ` &str ` as a type before, and we'll discuss the details of
2727strings later. In systems programming languages, strings are a bit more complex
28- than in other languages. For now, just read ` &str ` as "a string slice," and
28+ than in other languages. For now, just read ` &str ` as a * string slice* , and
2929we'll learn more soon.
3030
31- You can access the fields in a tuple through a ** destructuring let* * . Here's
31+ You can access the fields in a tuple through a * destructuring let* . Here's
3232an example:
3333
3434``` rust
@@ -40,8 +40,8 @@ println!("x is {}", x);
4040Remember before when I said the left-hand side of a ` let ` statement was more
4141powerful than just assigning a binding? Here we are. We can put a pattern on
4242the left-hand side of the ` let ` , and if it matches up to the right-hand side,
43- we can assign multiple bindings at once. In this case, ` let ` ' destructures,'
44- or ' breaks up,' the tuple, and assigns the bits to three bindings.
43+ we can assign multiple bindings at once. In this case, ` let ` " destructures,"
44+ or " breaks up," the tuple, and assigns the bits to three bindings.
4545
4646This pattern is very powerful, and we'll see it repeated more later.
4747
@@ -83,18 +83,18 @@ fn main() {
8383}
8484```
8585
86- Even though Rust functions can only return one value, a tuple _ is _ one value,
87- that happens to be made up of more than one value. You can also see in this example how you
88- can destructure a pattern returned by a function, as well.
86+ Even though Rust functions can only return one value, a tuple * is * one value,
87+ that happens to be made up of more than one value. You can also see in this
88+ example how you can destructure a pattern returned by a function, as well.
8989
9090Tuples are a very simple data structure, and so are not often what you want.
9191Let's move on to their bigger sibling, structs.
9292
9393## Structs
9494
95- A struct is another form of a ' record type,' just like a tuple. There's a
95+ A struct is another form of a * record type* , just like a tuple. There's a
9696difference: structs give each element that they contain a name, called a
97- ' field' or a ' member.' Check it out:
97+ * field* or a * member* . Check it out:
9898
9999``` rust
100100struct Point {
@@ -143,8 +143,7 @@ This will print `The point is at (5, 0)`.
143143## Tuple Structs and Newtypes
144144
145145Rust has another data type that's like a hybrid between a tuple and a struct,
146- called a ** tuple struct** . Tuple structs do have a name, but their fields
147- don't:
146+ called a * tuple struct* . Tuple structs do have a name, but their fields don't:
148147
149148
150149``` {rust}
@@ -182,7 +181,7 @@ Now, we have actual names, rather than positions. Good names are important,
182181and with a struct, we have actual names.
183182
184183There _ is_ one case when a tuple struct is very useful, though, and that's a
185- tuple struct with only one element. We call this a ' newtype,' because it lets
184+ tuple struct with only one element. We call this a * newtype* , because it lets
186185you create a new type that's a synonym for another one:
187186
188187``` {rust}
@@ -199,7 +198,7 @@ destructuring `let`.
199198
200199## Enums
201200
202- Finally, Rust has a "sum type", an ** enum* * . Enums are an incredibly useful
201+ Finally, Rust has a "sum type", an * enum* . Enums are an incredibly useful
203202feature of Rust, and are used throughout the standard library. This is an enum
204203that is provided by the Rust standard library:
205204
0 commit comments