-
Notifications
You must be signed in to change notification settings - Fork 46
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
const fn
-ify what can be const
of the API
#31
Conversation
This helps to remove lazy initialization to initialize global static variables containing `FxHashMap`/`FxHashSet`.
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.
Thanks!
FxHasher { hash: seed } | ||
} | ||
|
||
/// Create a default `fq` hasher. |
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.
Typo: fq
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.
Also: what's the point of creating a default
function in this impl
when Default
is already impl'd? I'm actually surprised this even works.
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.
The point is that it can be const. I think a different name would be nicer though.
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.
Default
is not a #[const_trait]
yet and feature const_trait_impl
/effects
is still very much WIP. The inherent associated function default
can be used in const contexts contrary to the trait associated function. Inherent associated items have precedence over their trait counterpart.
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.
Hm, it could be called new
This helps to remove lazy initialization to initialize global static variables containing
FxHashMap
/FxHashSet
.