Skip to content

Commit 969993c

Browse files
bobflukewilson2002
authored andcommitted
Fix anonymous struct usage
ziglang/zig#21817
1 parent 9d1f4ea commit 969993c

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/zmd/tokens.zig

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,12 @@ pub const elements = [_]Element{
6666
.{ .type = .ordered_list_item, .syntax = "1. ", .close = .linebreak, .clear = true },
6767
};
6868

69-
pub const toggles = if (@hasDecl(std, "ComptimeStringMap"))
70-
std.ComptimeStringMap(
71-
Element,
72-
.{
73-
.{ "code", .{ .type = .code_close, .syntax = "`" } },
74-
.{ "block", .{ .type = .block_close, .syntax = "```" } },
75-
},
76-
)
77-
else if (@hasDecl(std, "StaticStringMap"))
78-
std.StaticStringMap(Element).initComptime(
79-
.{
80-
.{ "code", .{ .type = .code_close, .syntax = "`" } },
81-
.{ "block", .{ .type = .block_close, .syntax = "```" } },
82-
},
83-
)
84-
else
85-
unreachable;
69+
pub const toggles = std.StaticStringMap(Element).initComptime(
70+
.{
71+
.{ "code", Element{ .type = .code_close, .syntax = "`" } },
72+
.{ "block", Element{ .type = .block_close, .syntax = "```" } },
73+
},
74+
);
8675

8776
pub const formatters = [_]Element{
8877
.{ .type = .bold, .syntax = "**", .close = .bold_close },

0 commit comments

Comments
 (0)