diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-08-17 06:25:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-17 06:25:26 -0700 |
| commit | c1e9ea0b2d3d192407ec03731cbaf6e2ddd818b7 (patch) | |
| tree | 75229b357049d10aae2ed5e14cba28517c6e5be8 /src/libcore | |
| parent | 49a2873cfcc728f096765323dd209a6c76126f60 (diff) | |
| parent | 2c9a1d9c4aca14ddca4a9b6bd4631b04ade43497 (diff) | |
| download | rust-c1e9ea0b2d3d192407ec03731cbaf6e2ddd818b7.tar.gz rust-c1e9ea0b2d3d192407ec03731cbaf6e2ddd818b7.zip | |
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.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter/range.rs | 17 |
1 files changed, 2 insertions, 15 deletions
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<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 } } - |
