-
Notifications
You must be signed in to change notification settings - Fork 38
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
Mark constant functions with const
#571
Conversation
Good stuff. May I suggest you also use the opportunity to add the lint to our CI, so we cannot merge code that violates this rule going forward? |
Let's discuss this in #587, @einar-polygon |
I wasn't aware of the nursery status. The current PR should be safe to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing problematic about these changes.
Using
const
for constant functions allows the compiler to evaluate them at compile-time, and allows the calling functions to beconst
, too.These functions were detected with the clippy lint:
https://rust-lang.github.io/rust-clippy/master/index.html#/missing_const_for_fn