Skip to content

Commit 6a19674

Browse files
chrisbbreuerclaude
andcommitted
fix: update to Zig 0.16-dev APIs
- Replace std.time.timestamp() with std.Io.Timestamp.now(io, .real).toSeconds() - Auto-format files for 0.16-dev zig fmt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1c87276 commit 6a19674

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/files.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub const FileType = enum {
3838

3939
pub fn isTomlFile(self: FileType) bool {
4040
return self == .cargo_toml or self == .pyproject_toml or
41-
self == .ion_toml or self == .generic_toml;
41+
self == .ion_toml or self == .generic_toml;
4242
}
4343
};
4444

@@ -214,8 +214,8 @@ fn findVersionInText(allocator: Allocator, content: []const u8) !?[]u8 {
214214
// Look for semantic version patterns in text
215215
// Pattern: \bX.Y.Z\b (word boundaries)
216216
const semver_pattern = std.mem.indexOf(u8, content, "0.") orelse
217-
std.mem.indexOf(u8, content, "1.") orelse
218-
return null;
217+
std.mem.indexOf(u8, content, "1.") orelse
218+
return null;
219219

220220
// Extract the version starting from this position
221221
var end = semver_pattern;

src/main.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ fn generateChangelog(allocator: std.mem.Allocator, io: std.Io, version: []const
321321
};
322322
defer allocator.free(existing_content);
323323

324-
const ts = std.posix.clock_gettime(std.posix.CLOCK.REALTIME) catch unreachable;
325-
const epoch_seconds = ts.sec;
324+
const epoch_seconds = std.Io.Timestamp.now(io, .real).toSeconds();
326325
const days_since_epoch = @divFloor(epoch_seconds, 86400);
327326
const days_since_1970 = days_since_epoch;
328327

src/test_version.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn bumpVersion(allocator: std.mem.Allocator, version: []const u8, release_type:
2525
return error.InvalidReleaseType;
2626
}
2727

28-
return try std.fmt.allocPrint(allocator, "{d}.{d}.{d}", .{parts[0], parts[1], parts[2]});
28+
return try std.fmt.allocPrint(allocator, "{d}.{d}.{d}", .{ parts[0], parts[1], parts[2] });
2929
}
3030

3131
fn findVersion(allocator: std.mem.Allocator, content: []const u8) !?[]u8 {

0 commit comments

Comments
 (0)