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

Support for tuples #198

Open
SorteKanin opened this issue Nov 22, 2020 · 1 comment
Open

Support for tuples #198

SorteKanin opened this issue Nov 22, 2020 · 1 comment
Labels

Comments

@SorteKanin
Copy link

SorteKanin commented Nov 22, 2020

I would like to be able to make a set of tuples, like so:

use phf::phf_set;
static MY_SET: phf::Set<(&str, u32, &[&str])> = phf_set! {
    ("some value", 1, &["even", "more", "values"]),
};

This is currently not possible it seems. I am guessing it's also not possible to use tuples as keys in phf::Map

You can work around this by using phf_map with the first value as key and the rest as the resulting value but that isn't very ergonomic and also only works if the first value is unique.

@stephanemagnenat
Copy link

As with #183 it would be good for this limitation to be clearly documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants