]> gitweb.ps.run Git - chirp/commitdiff
fix paginate iterator behaviour
authorpatrick-scho <patrick.schoenberger@posteo.de>
Sun, 6 Apr 2025 14:21:39 +0000 (16:21 +0200)
committerpatrick-scho <patrick.schoenberger@posteo.de>
Sun, 6 Apr 2025 14:21:39 +0000 (16:21 +0200)
src/main.zig

index 7fe3b637717730fb35208295b09ce4e031d04625..0800e2b41439a301da86e345d4b30388577195fd 100644 (file)
@@ -463,16 +463,12 @@ pub fn Paginate(comptime T: type) type {
                 it.idx = try parse_enum(T.Base.Key, starting_at_str, 16);
             }
 
-            if (it.idx == null) {
-                return error.InvalidIterator;
-            }
-
             return .{
                 .res = res,
                 .view = view,
                 .per_page = per_page,
                 .it = it,
-                .starting_idx = it.idx.?,
+                .starting_idx = it.idx,
             };
         }
         pub fn next(self: *Self) IterateResult {