mirror of
https://codeberg.org/kaasboteram/zig-iterating.git
synced 2025-12-15 09:43:14 +01:00
Changed Iter(T).empty from function with no parameters to constant
This commit is contained in:
parent
075b246858
commit
1907a41fe5
1 changed files with 2 additions and 4 deletions
|
|
@ -20,14 +20,12 @@ pub fn Iter(comptime T: type) type {
|
|||
return .{ .inner = .{ .value = value } };
|
||||
}
|
||||
|
||||
pub fn empty() Iterator(Empty(T)) {
|
||||
return .{ .inner = .{} };
|
||||
}
|
||||
pub const empty: Iterator(Empty(T)) = .{ .inner = .{} };
|
||||
|
||||
test empty {
|
||||
const testing = @import("std").testing;
|
||||
|
||||
var it = Iter(i32).empty();
|
||||
var it = Iter(i32).empty;
|
||||
|
||||
try testing.expectEqual(null, it.next());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue