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

Remove Slice and upgrade len and is_empty to const-fns #224

Merged
merged 2 commits into from Jul 26, 2021

Conversation

bhgomes
Copy link
Contributor

@bhgomes bhgomes commented Jul 23, 2021

The len and is_empty functions of the four PHF types are upgraded to const-fns.

Implementation Detail

In this implementation, I could only upgrade them when the std feature is turned off because of the definition of Slice. I'm not sure what the purpose of the Dynamic variant is on Slice. Is there any reason we can't switch to slice?

@JohnTitor
Copy link
Member

In this implementation, I could only upgrade them when the std feature is turned off because of the definition of Slice. I'm not sure what the purpose of the Dynamic variant is on Slice. Is there any reason we can't switch to slice?

The Dynamic variant was used to be required by the phf_builder crate, which has been removed now (ref. 67b00ba). So, there's no use of it now and I think we can safely remove the enum.

@bhgomes bhgomes changed the title Upgrade len and is_empty to const-fns Remove Slice and upgrade len and is_empty to const-fns Jul 25, 2021
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@JohnTitor JohnTitor merged commit 65deaf7 into rust-phf:master Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants