mirror of
https://codeberg.org/kaasboteram/zig-iterating.git
synced 2026-02-18 21:17:04 +01:00
Reformatted Iter example usage
This commit is contained in:
parent
50b1919d03
commit
1d7ef3ab9d
1 changed files with 7 additions and 5 deletions
12
src/root.zig
12
src/root.zig
|
|
@ -36,11 +36,13 @@ test Iter {
|
||||||
|
|
||||||
const items = try Iter(i32)
|
const items = try Iter(i32)
|
||||||
.once(-100)
|
.once(-100)
|
||||||
.chain(Iter(i32)
|
.chain(
|
||||||
.rangeInclusive(1, 100)
|
Iter(i32)
|
||||||
.filter(arith.is_square)
|
.rangeInclusive(1, 100)
|
||||||
.chain(Iter(i32)
|
.filter(arith.is_square)
|
||||||
.range(0, 10)))
|
.chain(Iter(i32)
|
||||||
|
.range(0, 10)),
|
||||||
|
)
|
||||||
.toOwnedSlice(gpa);
|
.toOwnedSlice(gpa);
|
||||||
|
|
||||||
defer gpa.free(items);
|
defer gpa.free(items);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue