Skip to content

Commit 983cae7

Browse files
authored
Clarify Step Documentation
While the redesign is in progress (#62886), clarify the purpose of replace_zero and replace_one.
1 parent b9cf541 commit 983cae7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/libcore/iter/range.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ pub trait Step: Clone + PartialOrd + Sized {
2020
/// without overflow.
2121
fn steps_between(start: &Self, end: &Self) -> Option<usize>;
2222

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

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

2933
/// Adds one to this step, returning the result.

0 commit comments

Comments
 (0)