@@ -101,10 +101,10 @@ So, now that we've established that ranges are often not what you want, let's
101
101
talk about what you do want instead.
102
102
103
103
There are three broad classes of things that are relevant here: iterators,
104
- * iterator adapters * , and * consumers* . Here's some definitions:
104
+ * iterator adaptors * , and * consumers* . Here's some definitions:
105
105
106
106
* * iterators* give you a sequence of values.
107
- * * iterator adapters * operate on an iterator, producing a new iterator with a
107
+ * * iterator adaptors * operate on an iterator, producing a new iterator with a
108
108
different output sequence.
109
109
* * consumers* operate on an iterator, producing some final set of values.
110
110
@@ -246,12 +246,12 @@ for num in nums.iter() {
246
246
These two basic iterators should serve you well. There are some more
247
247
advanced iterators, including ones that are infinite.
248
248
249
- That's enough about iterators. Iterator adapters are the last concept
249
+ That's enough about iterators. Iterator adaptors are the last concept
250
250
we need to talk about with regards to iterators. Let's get to it!
251
251
252
- ## Iterator adapters
252
+ ## Iterator adaptors
253
253
254
- * Iterator adapters * take an iterator and modify it somehow, producing
254
+ * Iterator adaptors * take an iterator and modify it somehow, producing
255
255
a new iterator. The simplest one is called ` map ` :
256
256
257
257
``` rust,ignore
@@ -280,7 +280,7 @@ doesn't print any numbers:
280
280
If you are trying to execute a closure on an iterator for its side effects,
281
281
just use ` for ` instead.
282
282
283
- There are tons of interesting iterator adapters . ` take(n) ` will return an
283
+ There are tons of interesting iterator adaptors . ` take(n) ` will return an
284
284
iterator over the next ` n ` elements of the original iterator. Let's try it out
285
285
with an infinite iterator:
286
286
@@ -329,7 +329,7 @@ a few times, and then consume the result. Check it out:
329
329
330
330
This will give you a vector containing ` 6 ` , ` 12 ` , ` 18 ` , ` 24 ` , and ` 30 ` .
331
331
332
- This is just a small taste of what iterators, iterator adapters , and consumers
332
+ This is just a small taste of what iterators, iterator adaptors , and consumers
333
333
can help you with. There are a number of really useful iterators, and you can
334
334
write your own as well. Iterators provide a safe, efficient way to manipulate
335
335
all kinds of lists. They're a little unusual at first, but if you play with
0 commit comments