mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 20:24:32 -06:00
rebuild pages at a534180
This commit is contained in:
@@ -203,9 +203,8 @@ memory. The borrowing rules prevent programs from ending up in that situation.</
|
||||
<p>At the beginning of this chapter, we said that vectors can only store values
|
||||
that are all the same type. This can be inconvenient; there are definitely use
|
||||
cases for needing to store a list of things of different types. Luckily, the
|
||||
variants of an enum are all defined under the same enum type. When we need to
|
||||
store elements of a different type in a vector this scenario, we can define and
|
||||
use an enum!</p>
|
||||
variants of an enum are all defined under the same enum type, so when we need to
|
||||
store elements of a different type in a vector, we can define and use an enum!</p>
|
||||
<p>For example, let's say we want to get values from a row in a spreadsheet, where
|
||||
some of the columns in the row contain integers, some floating point numbers,
|
||||
and some strings. We can define an enum whose variants will hold the different
|
||||
|
||||
+2
-3
@@ -5705,9 +5705,8 @@ memory. The borrowing rules prevent programs from ending up in that situation.</
|
||||
<p>At the beginning of this chapter, we said that vectors can only store values
|
||||
that are all the same type. This can be inconvenient; there are definitely use
|
||||
cases for needing to store a list of things of different types. Luckily, the
|
||||
variants of an enum are all defined under the same enum type. When we need to
|
||||
store elements of a different type in a vector this scenario, we can define and
|
||||
use an enum!</p>
|
||||
variants of an enum are all defined under the same enum type, so when we need to
|
||||
store elements of a different type in a vector, we can define and use an enum!</p>
|
||||
<p>For example, let's say we want to get values from a row in a spreadsheet, where
|
||||
some of the columns in the row contain integers, some floating point numbers,
|
||||
and some strings. We can define an enum whose variants will hold the different
|
||||
|
||||
Reference in New Issue
Block a user