File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -2620,10 +2620,10 @@ pub trait Step: Ord {
2620
2620
/// Change self to the previous object.
2621
2621
fn step_back ( & mut self ) ;
2622
2622
/// The steps_between two step objects.
2623
- /// a should always be less than b , so the result should never be negative.
2623
+ /// start should always be less than end , so the result should never be negative.
2624
2624
/// Return None if it is not possible to calculate steps_between without
2625
2625
/// overflow.
2626
- fn steps_between ( a : & Self , b : & Self ) -> Option < uint > ;
2626
+ fn steps_between ( start : & Self , end : & Self ) -> Option < uint > ;
2627
2627
}
2628
2628
2629
2629
macro_rules! step_impl {
@@ -2635,9 +2635,9 @@ macro_rules! step_impl {
2635
2635
#[ inline]
2636
2636
fn step_back( & mut self ) { * self -= 1 ; }
2637
2637
#[ inline]
2638
- fn steps_between( a : & $t, b : & $t) -> Option <uint> {
2639
- debug_assert!( a < b ) ;
2640
- Some ( ( * a - * b ) as uint)
2638
+ fn steps_between( start : & $t, end : & $t) -> Option <uint> {
2639
+ debug_assert!( end >= start ) ;
2640
+ Some ( ( * end - * start ) as uint)
2641
2641
}
2642
2642
}
2643
2643
) * )
@@ -2652,7 +2652,7 @@ macro_rules! step_impl_no_between {
2652
2652
#[ inline]
2653
2653
fn step_back( & mut self ) { * self -= 1 ; }
2654
2654
#[ inline]
2655
- fn steps_between( _a : & $t, _b : & $t) -> Option <uint> {
2655
+ fn steps_between( _start : & $t, _end : & $t) -> Option <uint> {
2656
2656
None
2657
2657
}
2658
2658
}
Original file line number Diff line number Diff line change @@ -803,7 +803,7 @@ impl<Idx: Clone + Step> Iterator<Idx> for Range<Idx> {
803
803
804
804
#[ inline]
805
805
fn size_hint ( & self ) -> ( uint , Option < uint > ) {
806
- if let Some ( hint) = Step :: steps_between ( & self . end , & self . start ) {
806
+ if let Some ( hint) = Step :: steps_between ( & self . start , & self . end ) {
807
807
( hint, Some ( hint) )
808
808
} else {
809
809
( 0 , None )
You can’t perform that action at this time.
0 commit comments