From 0c43b6ef5c26f927b62eeaf3b365c88b07bf8d1a Mon Sep 17 00:00:00 2001 From: yettinmoor <51028130+yettinmoor@users.noreply.github.com> Date: Fri, 4 Sep 2020 21:11:09 +0200 Subject: [PATCH] document how to escape curly braces in fmt.format --- lib/std/fmt.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index 3067a55759..112377b887 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -82,6 +82,8 @@ fn peekIsAlign(comptime fmt: []const u8) bool { /// This allows user types to be formatted in a logical manner instead of dumping all fields of the type. /// /// A user type may be a `struct`, `vector`, `union` or `enum` type. +/// +/// To print literal curly braces, escape them by writing them twice, e.g. `{{` or `}}`. pub fn format( writer: anytype, comptime fmt: []const u8,