| ... | @@ -187,7 +187,7 @@ pub const DateTime = struct { | ... | @@ -187,7 +187,7 @@ pub const DateTime = struct { |
| 187 | | 187 | |
| 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 | } |
| 219 | | 219 | |
| ... | @@ -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; |
| 233 | | 233 | |
| 234 | if (comptime std.meta.stringToEnum(FormatSeq, fmt[s..e])) |tag| { | 234 | if (comptime std.meta.stringToEnum(FormatSeq, fmt[s..e])) |tag| { |