99
1010#![ allow( non_upper_case_globals) ]
1111
12- use phf:: OrderedSet ;
1312use serde:: { Deserialize , Deserializer , Serialize , Serializer } ;
1413
1514use std:: fmt;
@@ -25,7 +24,7 @@ use std::sync::Mutex;
2524use std:: sync:: atomic:: AtomicIsize ;
2625use std:: sync:: atomic:: Ordering :: SeqCst ;
2726
28- use string_cache_shared:: { self , UnpackedAtom , Static , Inline , Dynamic } ;
27+ use string_cache_shared:: { self , UnpackedAtom , Static , Inline , Dynamic , STATIC_ATOM_SET } ;
2928
3029#[ cfg( feature = "log-events" ) ]
3130use event:: Event ;
@@ -37,8 +36,6 @@ macro_rules! log (($e:expr) => (()));
3736// Needed for memory safety of the tagging scheme!
3837const ENTRY_ALIGNMENT : usize = 16 ;
3938
40- // Macro-generated table for static atoms.
41- static static_atom_set: OrderedSet < & ' static str > = static_atom_set ! ( ) ;
4239
4340struct StringCache {
4441 buckets : [ * mut StringCacheEntry ; 4096 ] ,
@@ -173,7 +170,7 @@ impl Atom {
173170
174171 #[ inline]
175172 pub fn from_slice ( string_to_add : & str ) -> Atom {
176- let unpacked = match static_atom_set . get_index ( string_to_add) {
173+ let unpacked = match STATIC_ATOM_SET . get_index ( string_to_add) {
177174 Some ( id) => Static ( id as u32 ) ,
178175 None => {
179176 let len = string_to_add. len ( ) ;
@@ -200,7 +197,7 @@ impl Atom {
200197 let buf = string_cache_shared:: inline_orig_bytes ( & self . data ) ;
201198 str:: from_utf8 ( buf) . unwrap ( )
202199 } ,
203- Static ( idx) => * static_atom_set . index ( idx as usize ) . expect ( "bad static atom" ) ,
200+ Static ( idx) => * STATIC_ATOM_SET . index ( idx as usize ) . expect ( "bad static atom" ) ,
204201 Dynamic ( entry) => {
205202 let entry = entry as * mut StringCacheEntry ;
206203 & ( * entry) . string
0 commit comments