File tree 1 file changed +2
-13
lines changed
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -235,26 +235,15 @@ Ranges are one of two basic iterators that you'll see. The other is `iter()`.
235
235
in turn:
236
236
237
237
``` rust
238
- let nums = [1 , 2 , 3 ];
238
+ let nums = vec! [1 , 2 , 3 ];
239
239
240
240
for num in nums . iter () {
241
241
println! (" {}" , num );
242
242
}
243
243
```
244
244
245
245
These two basic iterators should serve you well. There are some more
246
- advanced iterators, including ones that are infinite. Like using range syntax
247
- and ` step_by ` :
248
-
249
- ``` rust
250
- # #![feature(step_by)]
251
- (1 .. ). step_by (5 );
252
- ```
253
-
254
- This iterator counts up from one, adding five each time. It will give
255
- you a new integer every time, forever (well, technically, until it reaches the
256
- maximum number representable by an ` i32 ` ). But since iterators are lazy,
257
- that's okay! You probably don't want to use ` collect() ` on it, though...
246
+ advanced iterators, including ones that are infinite.
258
247
259
248
That's enough about iterators. Iterator adapters are the last concept
260
249
we need to talk about with regards to iterators. Let's get to it!
You can’t perform that action at this time.
0 commit comments