-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
🎊 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) { |
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.
extra space after ..
|
||
/// 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")] |
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.
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
Nice! r=me with just a few nits |
@bors: r=alexcrichton 1337291 |
bcf57d0
to
1d5983a
Compare
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]
⌛ Testing commit 1d5983a with merge 2b6af65... |
💔 Test failed - auto-mac-32-opt |
@bors: retry On Sat, Mar 14, 2015 at 7:58 AM, bors notifications@github.com wrote:
|
⌛ Testing commit 1d5983a with merge 7a306b1... |
💔 Test failed - auto-mac-32-opt |
@bors: retry |
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
This commit deprecates the
count
,range
andrange_step
functionsin
iter
, in favor of range notation. To recover all existingfunctionality, a new
step_by
adapter is provided directly onops::Range
and
ops::RangeFrom
.[breaking-change]
r? @alexcrichton