Skip to content
Snippets Groups Projects
Commit a5172225 authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Use Writer correctly for enums

parent 246737dc
No related branches found
No related tags found
No related merge requests found
......@@ -651,19 +651,20 @@ impl Enum {
_ => unreachable!(),
};
out.write(&format!("enum class {} : {} {{", self.name, size));
out.new_line();
out.write(&format!("enum class {} : {}", self.name, size));
out.open_brace();
for (i, value) in self.values.iter().enumerate() {
if i != 0 {
out.new_line()
}
out.write(&format!(" {} = {},", value.0, value.1));
out.write(&format!("{} = {},", value.0, value.1));
}
if config.enumeration.add_sentinel(&self.directives) {
out.write("\n\n Sentinel /* this must be last for serialization purposes. */");
out.new_line();
out.new_line();
out.write("Sentinel /* this must be last for serialization purposes. */");
}
out.new_line();
out.write("};");
out.close_brace(true);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment