File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 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()`.
235235in turn:
236236
237237``` rust
238- let nums = [1 , 2 , 3 ];
238+ let nums = vec! [1 , 2 , 3 ];
239239
240240for num in nums . iter () {
241241 println! (" {}" , num );
242242}
243243```
244244
245245These 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.
258247
259248That's enough about iterators. Iterator adapters are the last concept
260249we 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