authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-03-11 01:40:36 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-03-11 01:40:36 -08:00
logbfb7da7b8ee92b6c07f90a14b044a9b8f4df182c
tree93e407168f89bf37d570e5b5f49e9a40d6eafa6c
parentaff2df866eb16ad781e26a25f8b664d498e2211a

update to zig 0.11.0-dev.1681+0bb178bbb


1 files changed, 4 insertions(+), 4 deletions(-)

time.zig+4-4
...@@ -187,7 +187,7 @@ pub const DateTime = struct {...@@ -187,7 +187,7 @@ pub const DateTime = struct {
187187
188 pub fn dayOfThisYear(self: Self) u16 {188 pub fn dayOfThisYear(self: Self) u16 {
189 var ret: u16 = 0;189 var ret: u16 = 0;
190 for (range(self.months)) |_, item| {190 for (range(self.months), 0..) |_, item| {
191 ret += self.daysInMonth(@intCast(u16, item));191 ret += self.daysInMonth(@intCast(u16, item));
192 }192 }
193 ret += self.days;193 ret += self.days;
...@@ -212,8 +212,8 @@ pub const DateTime = struct {...@@ -212,8 +212,8 @@ pub const DateTime = struct {
212 fn daysSinceEpoch(self: Self) u64 {212 fn daysSinceEpoch(self: Self) u64 {
213 var res: u64 = 0;213 var res: u64 = 0;
214 res += self.days;214 res += self.days;
215 for (range(self.years - epoch_unix.years)) |_, i| res += time.daysInYear(@intCast(u16, i));215 for (0..self.years - epoch_unix.years) |i| res += time.daysInYear(@intCast(u16, i));
216 for (range(self.months)) |_, i| res += self.daysInMonth(@intCast(u16, i));216 for (0..self.months) |i| res += self.daysInMonth(@intCast(u16, i));
217 return res;217 return res;
218 }218 }
219219
...@@ -228,7 +228,7 @@ pub const DateTime = struct {...@@ -228,7 +228,7 @@ pub const DateTime = struct {
228 comptime var s = 0;228 comptime var s = 0;
229 comptime var e = 0;229 comptime var e = 0;
230 comptime var next: ?FormatSeq = null;230 comptime var next: ?FormatSeq = null;
231 inline for (fmt) |c, i| {231 inline for (fmt, 0..) |c, i| {
232 e = i + 1;232 e = i + 1;
233233
234 if (comptime std.meta.stringToEnum(FormatSeq, fmt[s..e])) |tag| {234 if (comptime std.meta.stringToEnum(FormatSeq, fmt[s..e])) |tag| {