Skip to content

Commit b78c9da

Browse files
committed
Use unique const names in string_cache_codegen
1 parent 23e9239 commit b78c9da

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

string-cache-codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "string_cache_codegen"
3-
version = "0.5.0" # Also update ../README.md when making a semver-breaking change
3+
version = "0.5.1" # Also update ../README.md when making a semver-breaking change
44
authors = [ "The Servo Project Developers" ]
55
description = "A codegen library for string-cache, developed as part of the Servo project."
66
license = "MIT / Apache-2.0"

string-cache-codegen/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,11 @@ impl AtomType {
227227
let type_name = new_term(type_name);
228228
let macro_name = new_term(&*self.macro_name);
229229
let module = module.parse::<proc_macro2::TokenStream>().unwrap();
230+
let atom_prefix = format!("ATOM_{}_", type_name.to_string().to_uppercase());
230231
let const_names: Vec<_> = atoms
231232
.iter()
232233
.map(|atom| {
233-
let mut name = String::from("ATOM");
234+
let mut name = atom_prefix.clone();
234235
for c in atom.chars() {
235236
name.push_str(&format!("_{:02X}", c as u32))
236237
}

0 commit comments

Comments
 (0)