From 1b99e08a9ed070adfb5bc1f6e62449ce57520dab Mon Sep 17 00:00:00 2001 From: jakubtomsu <66876057+jakubtomsu@users.noreply.github.com> Date: Thu, 16 Apr 2026 17:04:34 +0200 Subject: [PATCH] omit value when formatting map[T]struct{} --- core/fmt/fmt.odin | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 4ecb19c21..3118e7e5e 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -3132,12 +3132,14 @@ fmt_map :: proc(fi: ^Info, v: any, info: runtime.Type_Info_Map, verb: rune) { value := runtime.map_cell_index_dynamic(vs, info.map_info.vs, bucket_index) fmt_arg(&Info{writer = fi.writer}, any{rawptr(key), info.key.id}, verb) - if hash { - io.write_string(fi.writer, " = ", &fi.n) - } else { - io.write_string(fi.writer, "=", &fi.n) + if info.value.size > 0 { + if hash { + io.write_string(fi.writer, " = ", &fi.n) + } else { + io.write_string(fi.writer, "=", &fi.n) + } + fmt_arg(fi, any{rawptr(value), info.value.id}, verb) } - fmt_arg(fi, any{rawptr(value), info.value.id}, verb) if do_trailing_comma { io.write_string(fi.writer, ",\n", &fi.n) } }