authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2022-11-27 16:26:41-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 12:15:04-07:00
log906120bc2ce937e1dca047d1543b8caa7c843aea
tree4990a83c83865faa330cf2bf8eecaddea43eec51
parent9cb06f3b8bf9ea6b5e5307711bc97328762d6a1d

std.fmt: more descriptive names for impl functions

This is a workaround for a limitation of the C backend.

1 files changed, 9 insertions(+), 9 deletions(-)

lib/std/fmt.zig+9-9
......@@ -827,7 +827,7 @@ fn formatSliceHexImpl(comptime case: Case) type {
827827 const charset = "0123456789" ++ if (case == .upper) "ABCDEF" else "abcdef";
828828
829829 return struct {
830 pub fn f(
830 pub fn formatSliceHexImpl(
831831 bytes: []const u8,
832832 comptime fmt: []const u8,
833833 options: std.fmt.FormatOptions,
......@@ -846,8 +846,8 @@ fn formatSliceHexImpl(comptime case: Case) type {
846846 };
847847}
848848
849const formatSliceHexLower = formatSliceHexImpl(.lower).f;
850const formatSliceHexUpper = formatSliceHexImpl(.upper).f;
849const formatSliceHexLower = formatSliceHexImpl(.lower).formatSliceHexImpl;
850const formatSliceHexUpper = formatSliceHexImpl(.upper).formatSliceHexImpl;
851851
852852/// Return a Formatter for a []const u8 where every byte is formatted as a pair
853853/// of lowercase hexadecimal digits.
......@@ -865,7 +865,7 @@ fn formatSliceEscapeImpl(comptime case: Case) type {
865865 const charset = "0123456789" ++ if (case == .upper) "ABCDEF" else "abcdef";
866866
867867 return struct {
868 pub fn f(
868 pub fn formatSliceEscapeImpl(
869869 bytes: []const u8,
870870 comptime fmt: []const u8,
871871 options: std.fmt.FormatOptions,
......@@ -891,8 +891,8 @@ fn formatSliceEscapeImpl(comptime case: Case) type {
891891 };
892892}
893893
894const formatSliceEscapeLower = formatSliceEscapeImpl(.lower).f;
895const formatSliceEscapeUpper = formatSliceEscapeImpl(.upper).f;
894const formatSliceEscapeLower = formatSliceEscapeImpl(.lower).formatSliceEscapeImpl;
895const formatSliceEscapeUpper = formatSliceEscapeImpl(.upper).formatSliceEscapeImpl;
896896
897897/// Return a Formatter for a []const u8 where every non-printable ASCII
898898/// character is escaped as \xNN, where NN is the character in lowercase
......@@ -910,7 +910,7 @@ pub fn fmtSliceEscapeUpper(bytes: []const u8) std.fmt.Formatter(formatSliceEscap
910910
911911fn formatSizeImpl(comptime radix: comptime_int) type {
912912 return struct {
913 fn f(
913 fn formatSizeImpl(
914914 value: u64,
915915 comptime fmt: []const u8,
916916 options: FormatOptions,
......@@ -958,8 +958,8 @@ fn formatSizeImpl(comptime radix: comptime_int) type {
958958 };
959959}
960960
961const formatSizeDec = formatSizeImpl(1000).f;
962const formatSizeBin = formatSizeImpl(1024).f;
961const formatSizeDec = formatSizeImpl(1000).formatSizeImpl;
962const formatSizeBin = formatSizeImpl(1024).formatSizeImpl;
963963
964964/// Return a Formatter for a u64 value representing a file size.
965965/// This formatter represents the number as multiple of 1000 and uses the SI