authorgravatar for 109846069+noiryuh@users.noreply.github.comノYuh <109846069+noiryuh@users.noreply.github.com> 2022-09-23 16:20:38+07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-09-23 12:20:38+03:00
logeaaaceaf3cc3bab5312fee780891eafa8129eafb
tree985678e71dc299ac7fc3564f9f0f6cdf6731909b
parent0be46866fe6ece0680ceef95fd15362d15825bce
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

make `fmt.formatAsciiChar` respect `options` parameter


1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/fmt.zig+4-2
...@@ -1004,8 +1004,7 @@ pub fn formatAsciiChar(...@@ -1004,8 +1004,7 @@ pub fn formatAsciiChar(
1004 options: FormatOptions,1004 options: FormatOptions,
1005 writer: anytype,1005 writer: anytype,
1006) !void {1006) !void {
1007 _ = options;1007 return formatBuf(@as(*const [1]u8, &c), options, writer);
1008 return writer.writeAll(@as(*const [1]u8, &c));
1009}1008}
10101009
1011pub fn formatUnicodeCodepoint(1010pub fn formatUnicodeCodepoint(
...@@ -2724,6 +2723,9 @@ test "padding" {...@@ -2724,6 +2723,9 @@ test "padding" {
2724 try expectFmt("==crêpe===", "{s:=^10}", .{"crêpe"});2723 try expectFmt("==crêpe===", "{s:=^10}", .{"crêpe"});
2725 try expectFmt("=====crêpe", "{s:=>10}", .{"crêpe"});2724 try expectFmt("=====crêpe", "{s:=>10}", .{"crêpe"});
2726 try expectFmt("crêpe=====", "{s:=<10}", .{"crêpe"});2725 try expectFmt("crêpe=====", "{s:=<10}", .{"crêpe"});
2726 try expectFmt("====a", "{c:=>5}", .{'a'});
2727 try expectFmt("==a==", "{c:=^5}", .{'a'});
2728 try expectFmt("a====", "{c:=<5}", .{'a'});
2727}2729}
27282730
2729test "decimal float padding" {2731test "decimal float padding" {