ziglint icon indicating copy to clipboard operation
ziglint copied to clipboard

avoid `@Type(.EnumLiteral)` when possible

Open nektro opened this issue 1 year ago • 0 comments

its not something that should never be used, but using a discrete enum almost always makes code more readable and produces better error messages. FieldEnum and DeclEnum from std.meta go a long way in this regard. tactful in-line parameter enums can also be useful (eg foo: enum { fast, slow })

this also goes hand-in-hand with the general advice of preferring enum arguments over booleans

nektro avatar Apr 02 '24 23:04 nektro