Skip to content

Commit

Permalink
Clarify Step Documentation
Browse files Browse the repository at this point in the history
While the redesign is in progress (rust-lang#62886), clarify the purpose of replace_zero and replace_one.
  • Loading branch information
Phlosioneer authored Nov 20, 2019
1 parent b9cf541 commit 983cae7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libcore/iter/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ pub trait Step: Clone + PartialOrd + Sized {
/// without overflow.
fn steps_between(start: &Self, end: &Self) -> Option<usize>;

/// Replaces this step with `1`, returning itself.
/// Replaces this step with `1`, returning a clone of itself.
///
/// The output of this method should always be greater than the output of replace_zero.
fn replace_one(&mut self) -> Self;

/// Replaces this step with `0`, returning itself.
/// Replaces this step with `0`, returning a clone of itself.
///
/// The output of this method should always be less than the output of replace_one.
fn replace_zero(&mut self) -> Self;

/// Adds one to this step, returning the result.
Expand Down

0 comments on commit 983cae7

Please sign in to comment.