From bfb7da7b8ee92b6c07f90a14b044a9b8f4df182c Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 11 Mar 2023 01:40:36 -0800 Subject: [PATCH] update to zig 0.11.0-dev.1681+0bb178bbb --- time.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/time.zig b/time.zig index 493666efd1fe49d44f2b401c82d891ab71555b93..9f14c94e0c5987442faac7a3616d904963d979f8 100644 --- a/time.zig +++ b/time.zig @@ -187,7 +187,7 @@ pub const DateTime = struct { pub fn dayOfThisYear(self: Self) u16 { var ret: u16 = 0; - for (range(self.months)) |_, item| { + for (range(self.months), 0..) |_, item| { ret += self.daysInMonth(@intCast(u16, item)); } ret += self.days; @@ -212,8 +212,8 @@ pub const DateTime = struct { fn daysSinceEpoch(self: Self) u64 { var res: u64 = 0; res += self.days; - for (range(self.years - epoch_unix.years)) |_, i| res += time.daysInYear(@intCast(u16, i)); - for (range(self.months)) |_, i| res += self.daysInMonth(@intCast(u16, i)); + for (0..self.years - epoch_unix.years) |i| res += time.daysInYear(@intCast(u16, i)); + for (0..self.months) |i| res += self.daysInMonth(@intCast(u16, i)); return res; } @@ -228,7 +228,7 @@ pub const DateTime = struct { comptime var s = 0; comptime var e = 0; comptime var next: ?FormatSeq = null; - inline for (fmt) |c, i| { + inline for (fmt, 0..) |c, i| { e = i + 1; if (comptime std.meta.stringToEnum(FormatSeq, fmt[s..e])) |tag| { -- 2.54.0