We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98c0878 commit 9ac07d7Copy full SHA for 9ac07d7
src/slice.rs
@@ -51,14 +51,15 @@ impl Slice {
51
}
52
53
54
- /// Returns a new `Slice` with the given step size.
+ /// Create a new `Slice` with the given step size (multiplied with the
55
+ /// previous step size).
56
///
57
/// `step` must be nonzero.
58
/// (This method checks with a debug assertion that `step` is not zero.)
59
#[inline]
60
pub fn step_by(self, step: isize) -> Self {
61
debug_assert_ne!(step, 0, "Slice::step_by: step must be nonzero");
- Slice { step, ..self }
62
+ Slice { step: self.step * step, ..self }
63
64
65
0 commit comments