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