-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
accumulate into vector and assert, instead of printing #35695
Conversation
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.
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. |
Ah nice, thanks! @bors: r+ rollup |
📌 Commit c9f2055 has been approved by |
/// 4 | ||
/// 6 | ||
/// 8 | ||
/// let result: Vec<_> = (0..10).step_by(2).take(10).collect(); |
There was a problem hiding this comment.
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?
@Limeth Actually this example doesn't need a |
I learnt something new today. Thanks again! @bors: r+ rollup |
📌 Commit 2c9a1d9 has been approved by |
…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.
…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.
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..`.
…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..`.
…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..`.
…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..`.
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
…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..`.
…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..`.
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
…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..`.
…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..`.
…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..`.
…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..`.
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.