Skip to content

Use Self::Foo instead of importing variants with wildcard #372

@tcharding

Description

@tcharding

We have a ton of cases where we bring error variants into scope using use FooError::*;.

This was done so the pattern match is more terse, especially because error types can have long names. The same goal can be better achieved by using Self::Foo when matching.

The main benefit is that its more clear because for example FooError::Address leads to a bare Address in the pattern match which can be misleading at first glance.

Probably only worth doing if it can be done with AI because otherwise its a ton of work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions