-
Notifications
You must be signed in to change notification settings - Fork 181
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 #1521
base: master
Are you sure you want to change the base?
Conversation
Hey, thanks for this PR, but we don't want to have every function Said lint is allow-by-default for a reason and that is that However there is definitely use for However I would like to ask you to drop all other instances of |
I agree here, To illustrate the point: Constructing So:
Also, with |
I've pushed a commit to address this. I might do another pass on this, just to double-check since it's a lot of changes. Unrelated, but my editor automatically removed trailing whitespace from the files touched by either of the two commits. Would you like me to restore the trailing whitespace? |
…const context, pt 2
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