~jshholland/doomsday

d09fc44a963d9663c5bd9482572556987cc882cb — Josh Holland a month ago 101dd9e master
use explicit format options ready for next Zig release
1 files changed, 3 insertions(+), 3 deletions(-)

M src/main.zig
M src/main.zig => src/main.zig +3 -3
@@ 49,7 49,7 @@ const Date = struct {
    day: u8,

    pub fn format(self: Date, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
        try writer.print("{} {} {}", .{ self.day, @tagName(self.month), self.year });
        try writer.print("{d} {s} {d}", .{ self.day, @tagName(self.month), self.year });
    }

    fn dayOfWeek(self: Date) Day {


@@ 140,7 140,7 @@ fn askDay(d: Date) !void {
        if (readDay(b[0..n])) |read| {
            if (read == day) {
                const seconds = t.read() / 1_000_000_000;
                try stdout.print("Correct! You took {} second{}.\n", .{
                try stdout.print("Correct! You took {d} second{s}.\n", .{
                    seconds, plural(seconds),
                });
                return;


@@ 185,6 185,6 @@ pub fn main() !void {
}

fn usage(exe: []const u8) !void {
    std.log.err("Usage: {} [number]\n", .{exe});
    std.log.err("Usage: {s} [number]\n", .{exe});
    return error.Invalid;
}