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 {...@@ -827,7 +827,7 @@ fn formatSliceHexImpl(comptime case: Case) type {
827 const charset = "0123456789" ++ if (case == .upper) "ABCDEF" else "abcdef";827 const charset = "0123456789" ++ if (case == .upper) "ABCDEF" else "abcdef";
828828
829 return struct {829 return struct {
830 pub fn f(830 pub fn formatSliceHexImpl(
831 bytes: []const u8,831 bytes: []const u8,
832 comptime fmt: []const u8,832 comptime fmt: []const u8,
833 options: std.fmt.FormatOptions,833 options: std.fmt.FormatOptions,
...@@ -846,8 +846,8 @@ fn formatSliceHexImpl(comptime case: Case) type {...@@ -846,8 +846,8 @@ fn formatSliceHexImpl(comptime case: Case) type {
846 };846 };
847}847}
848848
849const formatSliceHexLower = formatSliceHexImpl(.lower).f;849const formatSliceHexLower = formatSliceHexImpl(.lower).formatSliceHexImpl;
850const formatSliceHexUpper = formatSliceHexImpl(.upper).f;850const formatSliceHexUpper = formatSliceHexImpl(.upper).formatSliceHexImpl;
851851
852/// Return a Formatter for a []const u8 where every byte is formatted as a pair852/// Return a Formatter for a []const u8 where every byte is formatted as a pair
853/// of lowercase hexadecimal digits.853/// of lowercase hexadecimal digits.
...@@ -865,7 +865,7 @@ fn formatSliceEscapeImpl(comptime case: Case) type {...@@ -865,7 +865,7 @@ fn formatSliceEscapeImpl(comptime case: Case) type {
865 const charset = "0123456789" ++ if (case == .upper) "ABCDEF" else "abcdef";865 const charset = "0123456789" ++ if (case == .upper) "ABCDEF" else "abcdef";
866866
867 return struct {867 return struct {
868 pub fn f(868 pub fn formatSliceEscapeImpl(
869 bytes: []const u8,869 bytes: []const u8,
870 comptime fmt: []const u8,870 comptime fmt: []const u8,
871 options: std.fmt.FormatOptions,871 options: std.fmt.FormatOptions,
...@@ -891,8 +891,8 @@ fn formatSliceEscapeImpl(comptime case: Case) type {...@@ -891,8 +891,8 @@ fn formatSliceEscapeImpl(comptime case: Case) type {
891 };891 };
892}892}
893893
894const formatSliceEscapeLower = formatSliceEscapeImpl(.lower).f;894const formatSliceEscapeLower = formatSliceEscapeImpl(.lower).formatSliceEscapeImpl;
895const formatSliceEscapeUpper = formatSliceEscapeImpl(.upper).f;895const formatSliceEscapeUpper = formatSliceEscapeImpl(.upper).formatSliceEscapeImpl;
896896
897/// Return a Formatter for a []const u8 where every non-printable ASCII897/// Return a Formatter for a []const u8 where every non-printable ASCII
898/// character is escaped as \xNN, where NN is the character in lowercase898/// 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...@@ -910,7 +910,7 @@ pub fn fmtSliceEscapeUpper(bytes: []const u8) std.fmt.Formatter(formatSliceEscap
910910
911fn formatSizeImpl(comptime radix: comptime_int) type {911fn formatSizeImpl(comptime radix: comptime_int) type {
912 return struct {912 return struct {
913 fn f(913 fn formatSizeImpl(
914 value: u64,914 value: u64,
915 comptime fmt: []const u8,915 comptime fmt: []const u8,
916 options: FormatOptions,916 options: FormatOptions,
...@@ -958,8 +958,8 @@ fn formatSizeImpl(comptime radix: comptime_int) type {...@@ -958,8 +958,8 @@ fn formatSizeImpl(comptime radix: comptime_int) type {
958 };958 };
959}959}
960960
961const formatSizeDec = formatSizeImpl(1000).f;961const formatSizeDec = formatSizeImpl(1000).formatSizeImpl;
962const formatSizeBin = formatSizeImpl(1024).f;962const formatSizeBin = formatSizeImpl(1024).formatSizeImpl;
963963
964/// Return a Formatter for a u64 value representing a file size.964/// Return a Formatter for a u64 value representing a file size.
965/// This formatter represents the number as multiple of 1000 and uses the SI965/// This formatter represents the number as multiple of 1000 and uses the SI