use struct update syntax in with_step()

This commit is contained in:
ge
2026-01-11 08:41:46 +03:00
parent 06f85c48d3
commit 39314b474b

View File

@@ -32,10 +32,8 @@ pub fn (mut r Range[T]) reset() {
// with_step returns copy of the range with new step value.
pub fn (r Range[T]) with_step[T](step T) Range[T] {
return Range[T]{
start: r.start
end: r.end
...r
step: step
is_neg: r.is_neg
cur: r.start
}
}