Skip to content

Commit

Permalink
zig- add missing string aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Jan 22, 2022
1 parent ed2276a commit 3db598a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
const string = []const u8;
const builtin = @import("builtin");
const deps = @import("./deps.zig");

Expand All @@ -19,7 +20,7 @@ pub fn build(b: *std.build.Builder) void {

const exe_options = b.addOptions();
exe.addOptions("build_options", exe_options);
exe_options.addOption([]const u8, "version", b.option([]const u8, "version", "") orelse "dev");
exe_options.addOption(string, "version", b.option(string, "version", "") orelse "dev");

exe.linkLibC();
deps.addAllTo(exe);
Expand Down
2 changes: 1 addition & 1 deletion src/db/Version.zig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub const Version = struct {
return try db.collect(alloc, Version, "select * from versions order by id desc limit 15", .{});
}

pub fn format(self: Version, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
pub fn format(self: Version, comptime fmt: string, options: std.fmt.FormatOptions, writer: anytype) !void {
_ = fmt;
_ = options;
try writer.print("v{d}.{d}", .{ self.real_major, self.real_minor });
Expand Down

0 comments on commit 3db598a

Please sign in to comment.