Replace {z} format specifiers with std.zig.fmtId

This commit is contained in:
Robin Voetter
2021-01-08 19:49:06 +01:00
parent 19138aa7a3
commit caaf915671

View File

@@ -139,13 +139,13 @@ pub const IdRenderer = struct {
}
pub fn render(self: IdRenderer, out: anytype, id: []const u8) !void {
try out.print("{z}", .{ id });
try out.print("{}", .{ std.zig.fmtId(id) });
}
pub fn renderFmt(self: *IdRenderer, out: anytype, comptime fmt: []const u8, args: anytype) !void {
self.text_cache.items.len = 0;
try std.fmt.format(self.text_cache.writer(), fmt, args);
try out.print("{z}", .{ self.text_cache.items });
try out.print("{}", .{ std.zig.fmtId(self.text_cache.items) });
}
pub fn renderWithCase(self: *IdRenderer, out: anytype, case_style: CaseStyle, id: []const u8) !void {
@@ -162,7 +162,7 @@ pub const IdRenderer = struct {
.camel => try self.renderCamel(false, adjusted_id, tag),
}
try out.print("{z}", .{ self.text_cache.items });
try out.print("{}", .{ std.zig.fmtId(self.text_cache.items) });
}
pub fn getAuthorTag(self: IdRenderer, id: []const u8) ?[]const u8 {