Skip to content

Commit f392c9b

Browse files
committed
Increment version numbers of affected crates
Also fix an unnoticed bug and render data as hex numbers.
1 parent 42f4684 commit f392c9b

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "string_cache"
4-
version = "0.7.1" # Also update README.md when making a semver-breaking change
4+
version = "0.7.2" # Also update README.md when making a semver-breaking change
55
authors = [ "The Servo Project Developers" ]
66
description = "A string interning library for Rust, developed as part of the Servo project."
77
license = "MIT / Apache-2.0"

src/atom.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use phf_shared;
1313
use serde::{Deserialize, Deserializer, Serialize, Serializer};
1414

15-
#[allow(unused_imports)] use std::ascii::AsciiExt;
1615
use std::borrow::Cow;
1716
use std::cmp::Ordering::{self, Equal};
1817
use std::fmt;

string-cache-codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "string_cache_codegen"
4-
version = "0.4.0" # Also update ../README.md when making a semver-breaking change
4+
version = "0.4.1" # Also update ../README.md when making a semver-breaking change
55
authors = [ "The Servo Project Developers" ]
66
description = "A codegen library for string-cache, developed as part of the Servo project."
77
license = "MIT / Apache-2.0"

string-cache-codegen/lib.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ impl AtomType {
192192
let atoms: Vec<&str> = map.iter().map(|&idx| atoms[idx]).collect();
193193
let atoms_ref = &atoms;
194194
let empty_string_index = atoms.iter().position(|s| s.is_empty()).unwrap() as u32;
195-
let data = (0..atoms.len()).map(|i| proc_macro2::Literal::u64_suffixed(shared::pack_static(i as u32)));
195+
let data = (0..atoms.len()).map(|i| {
196+
format!("0x{:X}u64", shared::pack_static(i as u32))
197+
.parse::<proc_macro2::TokenStream>()
198+
.unwrap()
199+
.into_iter()
200+
.next()
201+
.unwrap()
202+
});
196203

197204
let hashes: Vec<u32> =
198205
atoms.iter().map(|string| {
@@ -217,11 +224,11 @@ impl AtomType {
217224
Some(ref doc) => quote!(#[doc = #doc]),
218225
None => quote!()
219226
};
220-
let produce_term = |string: &str| proc_macro2::Term::new(string, proc_macro2::Span::call_site());
221-
let static_set_name = produce_term(&format!("{}StaticSet", type_name));
222-
let type_name = produce_term(type_name);
223-
let macro_name = produce_term(&*self.macro_name);
224-
let path = iter::repeat(produce_term(&*self.path));
227+
let new_term = |string: &str| proc_macro2::Term::new(string, proc_macro2::Span::call_site());
228+
let static_set_name = new_term(&format!("{}StaticSet", type_name));
229+
let type_name = new_term(type_name);
230+
let macro_name = new_term(&*self.macro_name);
231+
let path = iter::repeat(self.path.parse::<proc_macro2::TokenStream>().unwrap());
225232

226233
quote! {
227234
#atom_doc

0 commit comments

Comments
 (0)