Skip to content

Commit

Permalink
Rollup merge of rust-lang#35695 - matthew-piziak:vec-assert-over-prin…
Browse files Browse the repository at this point in the history
…tln, r=GuillaumeGomez

accumulate into vector and assert, instead of printing

I'm only making this change in one place so that people can express
their preferences for this stylistic change. If/when this change is
approved I'll go ahead and translate the rest of the `std::ops`
examples.
  • Loading branch information
Jonathan Turner committed Aug 17, 2016
2 parents 9126b08 + 2c9a1d9 commit 9163321
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/libcore/iter/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,8 @@ impl<A: Step> ops::Range<A> {
///
/// ```
/// #![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")]
Expand Down Expand Up @@ -650,4 +638,3 @@ impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> where
n
}
}

0 comments on commit 9163321

Please sign in to comment.