Skip to content

Commit

Permalink
Avoid mixing up the words elements and array/items.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebras committed Oct 15, 2019
1 parent 9fd678a commit 6598d3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ch03-02-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ vector. Chapter 8 discusses vectors in more detail.
An example of when you might want to use an array rather than a vector is in a
program that needs to know the names of the months of the year. It’s very
unlikely that such a program will need to add or remove months, so you can use
an array because you know it will always contain 12 items:
an array because you know it will always contain 12 elements:

```rust
let months = ["January", "February", "March", "April", "May", "June", "July",
Expand All @@ -334,7 +334,7 @@ let a: [i32; 5] = [1, 2, 3, 4, 5];
```

Here, `i32` is the type of each element. After the semicolon, the number `5`
indicates the element contains five items.
indicates the array contains five elements.

Writing an array’s type this way looks similar to an alternative syntax for
initializing an array: if you want to create an array that contains the same
Expand Down

0 comments on commit 6598d3a

Please sign in to comment.