Skip to content

Commit 4b2f40d

Browse files
committed
Remove unused Step methods
1 parent dbed18c commit 4b2f40d

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/libcore/iter/range.rs

-34
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ use super::{FusedIterator, TrustedLen};
2222
reason = "likely to be replaced by finer-grained traits",
2323
issue = "42168")]
2424
pub trait Step: PartialOrd + Sized {
25-
/// Steps `self` if possible.
26-
fn step(&self, by: &Self) -> Option<Self>;
27-
2825
/// Returns the number of steps between two step objects. The count is
2926
/// inclusive of `start` and exclusive of `end`.
3027
///
@@ -35,9 +32,6 @@ pub trait Step: PartialOrd + Sized {
3532
/// Same as `steps_between`, but with a `by` of 1
3633
fn steps_between_by_one(start: &Self, end: &Self) -> Option<usize>;
3734

38-
/// Tests whether this step is negative or not (going backwards)
39-
fn is_negative(&self) -> bool;
40-
4135
/// Replaces this step with `1`, returning itself
4236
fn replace_one(&mut self) -> Self;
4337

@@ -57,10 +51,6 @@ macro_rules! step_impl_unsigned {
5751
reason = "likely to be replaced by finer-grained traits",
5852
issue = "42168")]
5953
impl Step for $t {
60-
#[inline]
61-
fn step(&self, by: &$t) -> Option<$t> {
62-
(*self).checked_add(*by)
63-
}
6454
#[inline]
6555
#[allow(trivial_numeric_casts)]
6656
fn steps_between(start: &$t, end: &$t, by: &$t) -> Option<usize> {
@@ -79,11 +69,6 @@ macro_rules! step_impl_unsigned {
7969
}
8070
}
8171

82-
#[inline]
83-
fn is_negative(&self) -> bool {
84-
false
85-
}
86-
8772
#[inline]
8873
fn replace_one(&mut self) -> Self {
8974
mem::replace(self, 1)
@@ -117,10 +102,6 @@ macro_rules! step_impl_signed {
117102
reason = "likely to be replaced by finer-grained traits",
118103
issue = "42168")]
119104
impl Step for $t {
120-
#[inline]
121-
fn step(&self, by: &$t) -> Option<$t> {
122-
(*self).checked_add(*by)
123-
}
124105
#[inline]
125106
#[allow(trivial_numeric_casts)]
126107
fn steps_between(start: &$t, end: &$t, by: &$t) -> Option<usize> {
@@ -150,11 +131,6 @@ macro_rules! step_impl_signed {
150131
}
151132
}
152133

153-
#[inline]
154-
fn is_negative(&self) -> bool {
155-
*self < 0
156-
}
157-
158134
#[inline]
159135
fn replace_one(&mut self) -> Self {
160136
mem::replace(self, 1)
@@ -189,21 +165,11 @@ macro_rules! step_impl_no_between {
189165
reason = "likely to be replaced by finer-grained traits",
190166
issue = "42168")]
191167
impl Step for $t {
192-
#[inline]
193-
fn step(&self, by: &$t) -> Option<$t> {
194-
(*self).checked_add(*by)
195-
}
196168
#[inline]
197169
fn steps_between(_a: &$t, _b: &$t, _by: &$t) -> Option<usize> {
198170
None
199171
}
200172

201-
#[inline]
202-
#[allow(unused_comparisons)]
203-
fn is_negative(&self) -> bool {
204-
*self < 0
205-
}
206-
207173
#[inline]
208174
fn replace_one(&mut self) -> Self {
209175
mem::replace(self, 1)

0 commit comments

Comments
 (0)