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

Deprecate range, range_step, count, distributions #23347

Merged
merged 1 commit into from
Mar 16, 2015

Conversation

aturon
Copy link
Member

@aturon aturon commented Mar 13, 2015

This commit deprecates the count, range and range_step functions
in iter, in favor of range notation. To recover all existing
functionality, a new step_by adapter is provided directly on ops::Range
and ops::RangeFrom.

[breaking-change]

r? @alexcrichton

@steveklabnik
Copy link
Member

🎊 especially re the new adapter

@@ -1387,7 +1387,7 @@ fn merge_sort<T, F>(v: &mut [T], mut compare: F) where F: FnMut(&T, &T) -> Order
// We could hardcode the sorting comparisons here, and we could
// manipulate/step the pointers themselves, rather than repeatedly
// .offset-ing.
for start in range_step(0, len, insertion) {
for start in (0.. len).step_by(insertion) {
Copy link
Member

Choose a reason for hiding this comment

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

extra space after ..

@aturon aturon mentioned this pull request Mar 13, 2015
91 tasks

/// Creates a new counter with the specified start/step
#[inline]
#[unstable(feature = "core",
reason = "may be renamed or replaced by range notation adapters")]
#[deprecated(since = "1.0.0-beta", reason = "use range notation and step_by")]
Copy link
Member

Choose a reason for hiding this comment

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

I find it also helpful if the error message says something like "replace count(a, b) with (0..).step_by(b)" just so it's easy to know how to convert

@alexcrichton
Copy link
Member

Nice! r=me with just a few nits

@aturon
Copy link
Member Author

aturon commented Mar 13, 2015

@bors: r=alexcrichton 1337291

@aturon aturon force-pushed the stab-misc branch 2 times, most recently from bcf57d0 to 1d5983a Compare March 13, 2015 21:45
This commit deprecates the `count`, `range` and `range_step` functions
in `iter`, in favor of range notation. To recover all existing
functionality, a new `step_by` adapter is provided directly on `ops::Range`
and `ops::RangeFrom`.

[breaking-change]
@aturon
Copy link
Member Author

aturon commented Mar 13, 2015

@bors: r=alexcrichton 1d5983a

@bors
Copy link
Contributor

bors commented Mar 14, 2015

⌛ Testing commit 1d5983a with merge 2b6af65...

@bors
Copy link
Contributor

bors commented Mar 14, 2015

💔 Test failed - auto-mac-32-opt

@alexcrichton
Copy link
Member

@bors: retry

On Sat, Mar 14, 2015 at 7:58 AM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-32-opt
http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/4076


Reply to this email directly or view it on GitHub
#23347 (comment).

@bors
Copy link
Contributor

bors commented Mar 15, 2015

⌛ Testing commit 1d5983a with merge 7a306b1...

@bors
Copy link
Contributor

bors commented Mar 15, 2015

💔 Test failed - auto-mac-32-opt

@aturon
Copy link
Member Author

aturon commented Mar 16, 2015

@bors: retry

@bors
Copy link
Contributor

bors commented Mar 16, 2015

⌛ Testing commit 1d5983a with merge bde09ee...

bors added a commit that referenced this pull request Mar 16, 2015
This commit deprecates the `count`, `range` and `range_step` functions
in `iter`, in favor of range notation. To recover all existing
functionality, a new `step_by` adapter is provided directly on `ops::Range`
and `ops::RangeFrom`.

[breaking-change]

r? @alexcrichton
@bors bors merged commit 1d5983a into rust-lang:master Mar 16, 2015
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.

5 participants