Skip to content

Commit f26aa3d

Browse files
authored
Merge pull request #4055 from rust-lang/stack-types-clarity
A bit more clarity about all the stack types in 3.2
2 parents 08dc0d2 + 6b3fb81 commit f26aa3d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/ch03-02-data-types.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,14 @@ brackets:
271271
{{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs}}
272272
```
273273

274-
Arrays are useful when you want your data allocated on the stack rather than
275-
the heap (we will discuss the stack and the heap more in [Chapter
276-
4][stack-and-heap]<!-- ignore -->) or when you want to ensure you always have a
277-
fixed number of elements. An array isn’t as flexible as the vector type,
278-
though. A *vector* is a similar collection type provided by the standard
279-
library that *is* allowed to grow or shrink in size. If you’re unsure whether
280-
to use an array or a vector, chances are you should use a vector. [Chapter
281-
8][vectors]<!-- ignore --> discusses vectors in more detail.
274+
Arrays are useful when you want your data allocated on the stack, the same as
275+
the other types we have seen so far, rather than the heap (we will discuss the
276+
stack and the heap more in [Chapter 4][stack-and-heap]<!-- ignore -->) or when
277+
you want to ensure you always have a fixed number of elements. An array isn’t as
278+
flexible as the vector type, though. A *vector* is a similar collection type
279+
provided by the standard library that *is* allowed to grow or shrink in size. If
280+
you’re unsure whether to use an array or a vector, chances are you should use a
281+
vector. [Chapter 8][vectors]<!-- ignore --> discusses vectors in more detail.
282282

283283
However, arrays are more useful when you know the number of elements will not
284284
need to change. For example, if you were using the names of the month in a

0 commit comments

Comments
 (0)