Skip to content

Commit

Permalink
Make "unicase + macros" features work
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed May 3, 2022
1 parent baac7d0 commit 9d28619
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
@@ -1,6 +1,7 @@
[workspace]
members = [
"phf",
"phf/examples/unicase-example",
"phf_codegen",
"phf_codegen/test",
"phf_generator",
Expand Down
2 changes: 1 addition & 1 deletion phf/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ test = false
default = ["std"]
std = ["phf_shared/std"]
uncased = ["phf_shared/uncased"]
unicase = ["phf_shared/unicase"]
unicase = ["phf_macros?/unicase", "phf_shared/unicase"]
macros = [
"phf_macros",
"proc-macro-hack",
Expand Down
10 changes: 10 additions & 0 deletions phf/examples/unicase-example/Cargo.toml
@@ -0,0 +1,10 @@
[package]
name = "unicase-example"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
phf = { version = "0.10", features = ["macros", "unicase"] }
unicase = "2"
9 changes: 9 additions & 0 deletions phf/examples/unicase-example/src/main.rs
@@ -0,0 +1,9 @@
use phf::phf_map;
use unicase::UniCase;

pub static MAP: phf::Map<UniCase<&'static str>, isize> = phf_map!(
UniCase::ascii("Foo") => 0,
UniCase::unicode("Bar") => 1,
);

fn main() {}

0 comments on commit 9d28619

Please sign in to comment.