Skip to content

Commit bcd27d1

Browse files
author
bors-servo
authored
Auto merge of #261 - servo:phf, r=SimonSapin
Update phf to 0.8
2 parents b17fe79 + fcbf983 commit bcd27d1

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ difference = "2.0"
1919
encoding_rs = "0.8"
2020

2121
[dependencies]
22-
cssparser-macros = {path = "./macros", version = "0.3.3"}
22+
cssparser-macros = {path = "./macros", version = "0.4"}
2323
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cssparser-macros"
3-
version = "0.3.6"
3+
version = "0.4.0"
44
authors = ["Simon Sapin <[email protected]>"]
55
description = "Procedural macros for cssparser"
66
documentation = "https://docs.rs/cssparser-macros/"
@@ -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

+1-3
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)