mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-03 07:48:41 +08:00
Small wording edits
This commit is contained in:
parent
91396aa0e6
commit
2570566cb0
@ -1,16 +1,16 @@
|
||||
# Essential Collections
|
||||
|
||||
Rust's standard library includes a number of really useful data structures
|
||||
called 'collections'. Most types represent one specific value, but collections
|
||||
can contain multiple values inside of them. Each collection has different
|
||||
capabilities and costs, and choosing an appropriate one for the situation you're
|
||||
in is a skill you'll develop over time. In this chapter, we'll go over three
|
||||
collections which are used very often in Rust programs:
|
||||
called *collections*. Most other types represent one specific value, but
|
||||
collections can contain multiple values inside of them. Each collection has
|
||||
different capabilities and costs, and choosing an appropriate one for the
|
||||
situation you're in is a skill you'll develop over time. In this chapter, we'll
|
||||
go over three collections which are used very often in Rust programs:
|
||||
|
||||
* *Vector*s allow you to store a variable number of values next to each other.
|
||||
* We've seen *String*s before, but we'll talk about them some more: they're
|
||||
collections of characters.
|
||||
* *HashMap*s allow you to associate a value with a particular key.
|
||||
* A *Vector* allows you to store a variable number of values next to each other.
|
||||
* A *String* is a collection of characters. We've seen `String` before, but
|
||||
we'll talk about it in depth now.
|
||||
* A *HashMap* allows you to associate a value with a particular key.
|
||||
|
||||
There are more specialized variants of each of these data structures for
|
||||
special situations, but these are the most fundamental.
|
||||
particular situations, but these are the most fundamental and common.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Vectors
|
||||
|
||||
The first type we'll look at is `Vec<T>`, also known as a 'vector'. Vectors
|
||||
The first type we'll look at is `Vec<T>`, also known as a *vector*. Vectors
|
||||
allow you to store more than one value in a single data structure next to each
|
||||
other in memory.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user