From 0b06fd70c85090c7fa5a0ce210374a5e209bbbc9 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Thu, 30 Apr 2015 14:17:56 -0400 Subject: [PATCH] Fix code sample, remove unstable code Fixes #24977 --- src/doc/trpl/iterators.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/doc/trpl/iterators.md b/src/doc/trpl/iterators.md index eea575658b9..76f6a4243a0 100644 --- a/src/doc/trpl/iterators.md +++ b/src/doc/trpl/iterators.md @@ -235,7 +235,7 @@ Ranges are one of two basic iterators that you'll see. The other is `iter()`. in turn: ```rust -let nums = [1, 2, 3]; +let nums = vec![1, 2, 3]; for num in nums.iter() { println!("{}", num); @@ -243,18 +243,7 @@ for num in nums.iter() { ``` These two basic iterators should serve you well. There are some more -advanced iterators, including ones that are infinite. Like using range syntax -and `step_by`: - -```rust -# #![feature(step_by)] -(1..).step_by(5); -``` - -This iterator counts up from one, adding five each time. It will give -you a new integer every time, forever (well, technically, until it reaches the -maximum number representable by an `i32`). But since iterators are lazy, -that's okay! You probably don't want to use `collect()` on it, though... +advanced iterators, including ones that are infinite. That's enough about iterators. Iterator adapters are the last concept we need to talk about with regards to iterators. Let's get to it!