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(
10041004 options: FormatOptions,
10051005 writer: anytype,
10061006) !void {
1007 _ = options;
1008 return writer.writeAll(@as(*const [1]u8, &c));
1007 return formatBuf(@as(*const [1]u8, &c), options, writer);
10091008}
10101009
10111010pub fn formatUnicodeCodepoint(
......@@ -2724,6 +2723,9 @@ test "padding" {
27242723 try expectFmt("==crêpe===", "{s:=^10}", .{"crêpe"});
27252724 try expectFmt("=====crêpe", "{s:=>10}", .{"crêpe"});
27262725 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'});
27272729}
27282730
27292731test "decimal float padding" {