Changed Iter(T).empty from function with no parameters to constant

This commit is contained in:
Luuk Machielse 2025-11-03 13:17:23 +01:00
parent 075b246858
commit 1907a41fe5

View file

@ -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());
}