mirror of
https://github.com/gechandesu/ranges.git
synced 2026-11-15 21:13:56 +03:00
use struct update syntax in with_step()
This commit is contained in:
1 parent
06f85c48d3
commit
39314b474b
1 file changed
+1
-3
@@ -32,10 +32,8 @@ pub fn (mut r Range[T]) reset() {
|
|||||||
// with_step returns copy of the range with new step value.
|
// with_step returns copy of the range with new step value.
|
||||||
pub fn (r Range[T]) with_step[T](step T) Range[T] {
|
pub fn (r Range[T]) with_step[T](step T) Range[T] {
|
||||||
return Range[T]{
|
return Range[T]{
|
||||||
start: r.start
|
...r
|
||||||
end: r.end
|
|
||||||
step: step
|
step: step
|
||||||
is_neg: r.is_neg
|
|
||||||
cur: r.start
|
cur: r.start
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user