diff options
| author | CAD97 <cad97@cad97.com> | 2020-05-13 14:49:45 -0400 |
|---|---|---|
| committer | CAD97 <cad97@cad97.com> | 2020-05-13 15:00:18 -0400 |
| commit | cef616b1dc1b3e0aa846fd8325ab8dde94de12d5 (patch) | |
| tree | 4cb198e63fdcf89343d40d29270d9caddab66b64 /src | |
| parent | f34322d71f6ba523fb2c0ebef258d7e51a7531c8 (diff) | |
| download | rust-cef616b1dc1b3e0aa846fd8325ab8dde94de12d5.tar.gz rust-cef616b1dc1b3e0aa846fd8325ab8dde94de12d5.zip | |
Improve comments in iter::Step
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/iter/range.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index 1b096893902..9e54e69bc55 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -15,7 +15,7 @@ use super::{FusedIterator, TrustedLen}; /// This trait is `unsafe` because its implementation must be correct for /// the safety of `unsafe trait TrustedLen` implementations, and the results /// of using this trait can otherwise be trusted by `unsafe` code to be correct -/// and fulful the listed obligations. +/// and fulfill the listed obligations. #[unstable(feature = "step_trait", reason = "recently redesigned", issue = "42168")] pub unsafe trait Step: Clone + PartialOrd + Sized { /// Returns the number of *successor* steps required to get from `start` to `end`. @@ -27,8 +27,8 @@ pub unsafe trait Step: Clone + PartialOrd + Sized { /// /// For any `a`, `b`, and `n`: /// - /// * `steps_between(&a, &b) == Some(n)` if and only if `Step::forward(&a, n) == Some(b)` - /// * `steps_between(&a, &b) == Some(n)` if and only if `Step::backward(&a, n) == Some(a)` + /// * `steps_between(&a, &b) == Some(n)` if and only if `Step::forward_checked(&a, n) == Some(b)` + /// * `steps_between(&a, &b) == Some(n)` if and only if `Step::backward_checked(&a, n) == Some(a)` /// * `steps_between(&a, &b) == Some(n)` only if `a <= b` /// * Corollary: `steps_between(&a, &b) == Some(0)` if and only if `a == b` /// * Note that `a <= b` does _not_ imply `steps_between(&a, &b) != None`; |
