Adjust Step::forward_checked docs for large types

Co-Authored-By: Nadrieril Feneanar <nadrieril@users.noreply.github.com>
This commit is contained in:
CAD97
2020-03-14 15:13:18 -04:00
parent 2fcfd233f7
commit f34322d71f
2 changed files with 7 additions and 12 deletions

View File

@@ -45,8 +45,11 @@ pub unsafe trait Step: Clone + PartialOrd + Sized {
///
/// For any `a`, `n`, and `m`:
///
/// * `Step::forward_checked(a, n).and_then(|x| Step::forward_checked(x, m)) == n.checked_add(m).and_then(|x| Step::forward_checked(a, x))`
/// * `Step::forward_checked(a, n).and_then(|x| Step::forward_checked(x, m)) == try { Step::forward_checked(a, n.checked_add(m)?) }`
/// * `Step::forward_checked(a, n).and_then(|x| Step::forward_checked(x, m)) == Step::forward_checked(a, m).and_then(|x| Step::forward_checked(x, n))`
///
/// For any `a`, `n`, and `m` where `n + m` does not overflow:
///
/// * `Step::forward_checked(a, n).and_then(|x| Step::forward_checked(x, m)) == Step::forward_checked(a, n + m)`
///
/// For any `a` and `n`:
///