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

Add support for unicase::Ascii and uncased::Uncased #289

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

thaliaarchi
Copy link
Contributor

This PR adds full support for unicase::Ascii and the missing macro support for uncased::Uncased. Ascii is a newtype with no space overhead over &str, so is useful when Unicode-aware folding is not needed. The blocker for macro support with Uncased was lifted when Uncased::new was made const in 0.9.7. Tests pass.

UncasedStr::new was made const in uncased 0.9.7 after const transmute
was stabilized in Rust 1.56.
@thaliaarchi thaliaarchi deleted the branch rust-phf:master June 27, 2023 22:42
@thaliaarchi thaliaarchi deleted the master branch June 27, 2023 22:42
@thaliaarchi thaliaarchi restored the master branch June 27, 2023 22:42
@thaliaarchi
Copy link
Contributor Author

This was unintentionally closed when I renamed master in my fork to unicase-and-uncased

@thaliaarchi thaliaarchi reopened this Jun 27, 2023
@thaliaarchi
Copy link
Contributor Author

thaliaarchi commented Jun 27, 2023

The latest commit fixes an issue, where a macro_rules macro that calls phf_map! (etc.) would insert implicit parentheses around the call argument. This unwraps that group, so that phf_macros does not incorrectly reject those keys as invalid. An example of this pattern has been added as a test.

@thaliaarchi thaliaarchi force-pushed the master branch 2 times, most recently from f913261 to 2b0da38 Compare June 28, 2023 19:12
@thaliaarchi
Copy link
Contributor Author

thaliaarchi commented Jul 22, 2023

I've pulled master to resolve conflicts, because #291 does a subset of the changes I did in the second commit here.

Is there something blocking this PR?

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

Successfully merging this pull request may close these issues.

None yet

1 participant