Rollup merge of #35695 - matthew-piziak:vec-assert-over-println, 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.
This commit is contained in:
commit
c1e9ea0b2d
@ -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")]
|
||||
@ -650,4 +638,3 @@ impl<A: Step> DoubleEndedIterator for ops::RangeInclusive<A> where
|
||||
n
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user