mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
committed by
Christoffer Lerno
parent
b77f254ab1
commit
c0b109fbc1
@@ -14,15 +14,16 @@ fn void EnumMap.init(&self, ValueType init_value)
|
||||
}
|
||||
|
||||
|
||||
fn void! EnumMap.to_format(&self, Formatter* formatter) @dynamic
|
||||
fn usz! EnumMap.to_format(&self, Formatter* formatter) @dynamic
|
||||
{
|
||||
formatter.print("{ ")!;
|
||||
usz n = formatter.print("{ ")!;
|
||||
foreach (i, &value : self.values)
|
||||
{
|
||||
if (i != 0) formatter.print(", ")!;
|
||||
formatter.printf("%s: %s", (Enum)i, *value)!;
|
||||
n += formatter.printf("%s: %s", (Enum)i, *value)!;
|
||||
}
|
||||
formatter.print(" }")!;
|
||||
n += formatter.print(" }")!;
|
||||
return n;
|
||||
}
|
||||
|
||||
fn String EnumMap.to_string(&self, Allocator* using = mem::heap()) @dynamic
|
||||
|
||||
Reference in New Issue
Block a user