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

Consider making Drain an enum, or using Option::<Drain>::None to represent no drain output(s). #16

Open
evanlinjin opened this issue Jan 15, 2024 · 1 comment

Comments

@evanlinjin
Copy link
Member

Relevant Context:

@LLFourn
Copy link
Collaborator

LLFourn commented Jan 22, 2024

90% of the time you will just .unwrap_or(0) on the values so I came to the conclusion that in this case it's better just to let 0 signify None. I could be convinced otherwise but the comment doesn't weigh putting it in an Option that against the cost of matching or copious .unwrap_or(0).

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

No branches or pull requests

2 participants