Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accumulate into vector and assert, instead of printing #35695

Merged
merged 2 commits into from
Aug 17, 2016

Conversation

matthew-piziak
Copy link
Contributor

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.

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.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@matthew-piziak
Copy link
Contributor Author

r? @steveklabnik

@rust-highfive rust-highfive assigned steveklabnik and unassigned aturon Aug 15, 2016
@GuillaumeGomez
Copy link
Member

Ah nice, thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Aug 15, 2016

📌 Commit c9f2055 has been approved by GuillaumeGomez

/// 4
/// 6
/// 8
/// let result: Vec<_> = (0..10).step_by(2).take(10).collect();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have .take(5) instead?

@matthew-piziak
Copy link
Contributor Author

@Limeth Actually this example doesn't need a take call at all. Fixed. :)

r? @GuillaumeGomez

@steveklabnik

@GuillaumeGomez
Copy link
Member

I learnt something new today. Thanks again!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Aug 15, 2016

📌 Commit 2c9a1d9 has been approved by GuillaumeGomez

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 17, 2016
…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.
bors added a commit that referenced this pull request Aug 17, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 17, 2016
…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.
bors added a commit that referenced this pull request Aug 17, 2016
@bors bors merged commit 2c9a1d9 into rust-lang:master Aug 17, 2016
@matthew-piziak matthew-piziak deleted the vec-assert-over-println branch August 17, 2016 20:11
matthew-piziak added a commit to matthew-piziak/rust that referenced this pull request Aug 17, 2016
PR rust-lang#35695 for `Range` was approved, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 19, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 19, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 20, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
matthew-piziak added a commit to matthew-piziak/rust that referenced this pull request Aug 23, 2016
PR rust-lang#35695 for `Range` was approved, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.

add `fn main` wrappers to enable Rust Playground "Run" button
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Aug 25, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Aug 26, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
matthew-piziak added a commit to matthew-piziak/rust that referenced this pull request Aug 26, 2016
PR rust-lang#35695 for `Range` was approved, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.

add `fn main` wrappers to enable Rust Playground "Run" button
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 30, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 30, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants