diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index c234ef21db6..079dfe2a81f 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -295,20 +295,8 @@ impl ops::Range { /// /// ``` /// #![feature(step_by)] - /// - /// for i in (0..10).step_by(2) { - /// println!("{}", i); - /// } - /// ``` - /// - /// This prints: - /// - /// ```text - /// 0 - /// 2 - /// 4 - /// 6 - /// 8 + /// let result: Vec<_> = (0..10).step_by(2).collect(); + /// assert_eq!(result, vec![0, 2, 4, 6, 8]); /// ``` #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] @@ -650,4 +638,3 @@ impl DoubleEndedIterator for ops::RangeInclusive where n } } -