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 @@ -2726,10 +2726,10 @@ pub trait Step: Ord {
2726
2726
/// Change self to the previous object.
2727
2727
fn step_back ( & mut self ) ;
2728
2728
/// The steps_between two step objects.
2729
- /// a should always be less than b , so the result should never be negative.
2729
+ /// start should always be less than end , so the result should never be negative.
2730
2730
/// Return None if it is not possible to calculate steps_between without
2731
2731
/// overflow.
2732
- fn steps_between ( a : & Self , b : & Self ) -> Option < uint > ;
2732
+ fn steps_between ( start : & Self , end : & Self ) -> Option < uint > ;
2733
2733
}
2734
2734
2735
2735
macro_rules! step_impl {
@@ -2741,9 +2741,9 @@ macro_rules! step_impl {
2741
2741
#[ inline]
2742
2742
fn step_back( & mut self ) { * self -= 1 ; }
2743
2743
#[ inline]
2744
- fn steps_between( a : & $t, b : & $t) -> Option <uint> {
2745
- debug_assert!( a < b ) ;
2746
- Some ( ( * a - * b ) as uint)
2744
+ fn steps_between( start : & $t, end : & $t) -> Option <uint> {
2745
+ debug_assert!( end >= start ) ;
2746
+ Some ( ( * end - * start ) as uint)
2747
2747
}
2748
2748
}
2749
2749
) * )
@@ -2758,7 +2758,7 @@ macro_rules! step_impl_no_between {
2758
2758
#[ inline]
2759
2759
fn step_back( & mut self ) { * self -= 1 ; }
2760
2760
#[ inline]
2761
- fn steps_between( _a : & $t, _b : & $t) -> Option <uint> {
2761
+ fn steps_between( _start : & $t, _end : & $t) -> Option <uint> {
2762
2762
None
2763
2763
}
2764
2764
}
Original file line number Diff line number Diff line change @@ -943,7 +943,7 @@ impl<Idx: Clone + Step> Iterator for Range<Idx> {
943
943
944
944
#[ inline]
945
945
fn size_hint ( & self ) -> ( uint , Option < uint > ) {
946
- if let Some ( hint) = Step :: steps_between ( & self . end , & self . start ) {
946
+ if let Some ( hint) = Step :: steps_between ( & self . start , & self . end ) {
947
947
( hint, Some ( hint) )
948
948
} else {
949
949
( 0 , None )
You can’t perform that action at this time.
0 commit comments