Visitar URL original
avoid `@Type(.EnumLiteral)` when possible · Issue #32 · nektro/ziglint · GitHub
Skip to content

avoid @Type(.EnumLiteral) when possible #32

Open

Description

@nektro

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions