Skip to content

Commit c2ee037

Browse files
committed
541: split: use floored division in example assertion r=HadrienG2 a=cuviper Rounding can falsify the previous `width < 2 * height` assertions. For example, given lengths `(3, 3)`, it will split to `(1, 3)` and `(2, 3)`. cc rayon-rs#539 @HadrienG2
2 parents f376803 + 2e07d43 commit c2ee037

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/iter/splitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ use std::fmt::{self, Debug};
9999
/// // property will remain true in the final sub-ranges.
100100
/// let width = sub_range.rx.end - sub_range.rx.start;
101101
/// let height = sub_range.ry.end - sub_range.ry.start;
102-
/// assert!((width < 2 * height) && (height < 2 * width));
102+
/// assert!((width / 2 <= height) && (height / 2 <= width));
103103
/// });
104104
/// ```
105105
///

0 commit comments

Comments
 (0)