authorgravatar for 51028130+yettinmoor@users.noreply.github.comyettinmoor <51028130+yettinmoor@users.noreply.github.com> 2020-09-04 21:11:09+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-09-04 22:11:09+03:00
log0c43b6ef5c26f927b62eeaf3b365c88b07bf8d1a
treebfedd33ef8a22767e7a39705be1450ae00022019
parent6b2f4fd20d3c85e5db592f76dea8e56da54e9211
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

document how to escape curly braces in fmt.format


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

lib/std/fmt.zig+2
...@@ -82,6 +82,8 @@ fn peekIsAlign(comptime fmt: []const u8) bool {...@@ -82,6 +82,8 @@ fn peekIsAlign(comptime fmt: []const u8) bool {
82/// This allows user types to be formatted in a logical manner instead of dumping all fields of the type.82/// This allows user types to be formatted in a logical manner instead of dumping all fields of the type.
83///83///
84/// A user type may be a `struct`, `vector`, `union` or `enum` type.84/// A user type may be a `struct`, `vector`, `union` or `enum` type.
85///
86/// To print literal curly braces, escape them by writing them twice, e.g. `{{` or `}}`.
85pub fn format(87pub fn format(
86 writer: anytype,88 writer: anytype,
87 comptime fmt: []const u8,89 comptime fmt: []const u8,