Skip to content

Commit c022170

Browse files
committed
Update phf to 0.8
1 parent 6c69040 commit c022170

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dtoa-short = "0.3"
2424
heapsize = {version = ">= 0.3, < 0.5", optional = true}
2525
itoa = "0.4"
2626
matches = "0.1"
27-
phf = "0.7"
27+
phf = "0.8"
2828
procedural-masquerade = {path = "./procedural-masquerade", version = "0.1"}
2929
serde = {version = "1.0", optional = true}
3030
smallvec = "0.6"

macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ proc-macro = true
1313

1414
[dependencies]
1515
procedural-masquerade = {path = "../procedural-masquerade", version = "0.1"}
16-
phf_codegen = "0.7"
16+
phf_codegen = "0.8"
1717
quote = "1"
1818
syn = {version = "1", features = ["full", "extra-traits"]}
1919
proc-macro2 = "1"

macros/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ define_proc_macros! {
8686
let mut tokens = quote! {
8787
static MAP: ::cssparser::_internal__phf::Map<&'static str, #value_type> =
8888
};
89-
let mut initializer_bytes = Vec::new();
90-
map.build(&mut initializer_bytes).unwrap();
91-
tokens.append_all(syn::parse_str::<syn::Expr>(::std::str::from_utf8(&initializer_bytes).unwrap()));
89+
tokens.append_all(syn::parse_str::<proc_macro2::TokenStream>(&map.build().to_string()));
9290
tokens.append_all(quote!(;));
9391
tokens.to_string()
9492
}

0 commit comments

Comments
 (0)