Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes glob import of ErrorKind within Display #52

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

brooksprumo
Copy link
Contributor

Recently I learned about glob imports of enums and how they interact with match statements. Basically, glob imports of an enum that are used with a match can be a footgun. Refer to this playground:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9f0ce5f074f7b4a71f487ae8c6a1902d

So instead of a glob import, create a short alias of ErrorKind.

@andrewhickman andrewhickman merged commit c18ebbe into andrewhickman:main Jan 11, 2024
6 checks passed
@andrewhickman
Copy link
Owner

Thanks!

@brooksprumo brooksprumo deleted the glob branch January 12, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants