Skip to content
Closed
8 changes: 4 additions & 4 deletions src/timezone.zig
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub const Posix = struct {
const julian = try std.fmt.parseInt(u9, str[1..], 10);
return .{ .julian = .{ .day = julian } };
},
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9' => |_| {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9' => {
const julian = try std.fmt.parseInt(u9, str, 10);
return .{ .julian_leap = .{ .day = julian } };
},
Expand Down Expand Up @@ -522,7 +522,7 @@ pub const TZInfo = struct {
},
};

pub fn parse(allocator: std.mem.Allocator, reader: *std.io.Reader) !TZInfo {
pub fn parse(allocator: std.mem.Allocator, reader: *std.Io.Reader) !TZInfo {
var legacy_header = try reader.takeStruct(Header, .big); // handles endianness for us
if (!std.mem.eql(u8, &legacy_header.magic, "TZif")) return error.BadHeader;
if (legacy_header.version != 0 and legacy_header.version != '2' and legacy_header.version != '3') return error.BadVersion;
Expand All @@ -545,7 +545,7 @@ pub const TZInfo = struct {
}
}

fn parseBlock(allocator: std.mem.Allocator, reader: *std.io.Reader, header: Header, legacy: bool) !TZInfo {
fn parseBlock(allocator: std.mem.Allocator, reader: *std.Io.Reader, header: Header, legacy: bool) !TZInfo {
if (header.counts.isstdcnt != 0 and header.counts.isstdcnt != header.counts.typecnt) return error.Malformed; // rfc8536: isstdcnt [...] MUST either be zero or equal to "typecnt"
if (header.counts.isutcnt != 0 and header.counts.isutcnt != header.counts.typecnt) return error.Malformed; // rfc8536: isutcnt [...] MUST either be zero or equal to "typecnt"
if (header.counts.typecnt == 0) return error.Malformed; // rfc8536: typecnt [...] MUST NOT be zero
Expand Down Expand Up @@ -861,7 +861,7 @@ pub const Windows = struct {

const days_from_epoch = @divFloor(timestamp, s_per_day);
// first_of_month is the weekday on the first of the month
const first_of_month = zeit.weekdayFromDays(days_from_epoch - time.wDay + 1);
const first_of_month = zeit.weekdayFromDays(@intCast(days_from_epoch - time.wDay + 1));

// In the start transition month
if (time.wMonth == start.wMonth) {
Expand Down
Loading