@@ -24,7 +24,7 @@ use alloc::heap;
2424use alloc:: boxed:: Box ;
2525use collections:: string:: String ;
2626use std:: cmp:: Ordering :: { self , Equal } ;
27- use std:: hash:: { Hash , Hasher } ;
27+ use std:: hash:: Hash ;
2828use std:: sync:: Mutex ;
2929use std:: sync:: atomic:: AtomicInt ;
3030use std:: sync:: atomic:: Ordering :: SeqCst ;
@@ -41,7 +41,7 @@ macro_rules! log (($e:expr) => (()));
4141pub mod repr;
4242
4343// Needed for memory safety of the tagging scheme!
44- const ENTRY_ALIGNMENT : uint = 16 ;
44+ const ENTRY_ALIGNMENT : usize = 16 ;
4545
4646// Macro-generated table for static atoms.
4747static static_atom_set: OrderedSet < & ' static str > = static_atom_set ! ( ) ;
@@ -83,7 +83,7 @@ impl StringCache {
8383
8484 fn add ( & mut self , string_to_add : & str ) -> * mut StringCacheEntry {
8585 let hash = xxhash:: hash ( & string_to_add) ;
86- let bucket_index = ( hash & ( self . buckets . len ( ) -1 ) as u64 ) as uint ;
86+ let bucket_index = ( hash & ( self . buckets . len ( ) -1 ) as u64 ) as usize ;
8787 let mut ptr = self . buckets [ bucket_index] ;
8888
8989 while ptr != ptr:: null_mut ( ) {
@@ -132,7 +132,7 @@ impl StringCache {
132132
133133 debug_assert ! ( value. ref_count. load( SeqCst ) == 0 ) ;
134134
135- let bucket_index = ( value. hash & ( self . buckets . len ( ) -1 ) as u64 ) as uint ;
135+ let bucket_index = ( value. hash & ( self . buckets . len ( ) -1 ) as u64 ) as usize ;
136136
137137 let mut current = self . buckets [ bucket_index] ;
138138 let mut prev: * mut StringCacheEntry = ptr:: null_mut ( ) ;
@@ -204,7 +204,7 @@ impl Atom {
204204 let buf = repr:: inline_orig_bytes ( & self . data ) ;
205205 str:: from_utf8 ( buf) . unwrap ( )
206206 } ,
207- Static ( idx) => * static_atom_set. iter ( ) . idx ( idx as uint ) . expect ( "bad static atom" ) ,
207+ Static ( idx) => * static_atom_set. iter ( ) . idx ( idx as usize ) . expect ( "bad static atom" ) ,
208208 Dynamic ( entry) => {
209209 let entry = entry as * mut StringCacheEntry ;
210210 ( * entry) . string . as_slice ( )
@@ -485,22 +485,22 @@ mod tests {
485485
486486 #[ test]
487487 fn match_atom ( ) {
488- assert_eq ! ( 2 u , match Atom :: from_slice( "head" ) {
489- atom!( br) => 1 u ,
490- atom!( html) | atom!( head) => 2 u ,
491- _ => 3 u ,
488+ assert_eq ! ( 2 , match Atom :: from_slice( "head" ) {
489+ atom!( br) => 1 ,
490+ atom!( html) | atom!( head) => 2 ,
491+ _ => 3 ,
492492 } ) ;
493493
494- assert_eq ! ( 3 u , match Atom :: from_slice( "body" ) {
495- atom!( br) => 1 u ,
496- atom!( html) | atom!( head) => 2 u ,
497- _ => 3 u ,
494+ assert_eq ! ( 3 , match Atom :: from_slice( "body" ) {
495+ atom!( br) => 1 ,
496+ atom!( html) | atom!( head) => 2 ,
497+ _ => 3 ,
498498 } ) ;
499499
500- assert_eq ! ( 3 u , match Atom :: from_slice( "zzzzzz" ) {
501- atom!( br) => 1 u ,
502- atom!( html) | atom!( head) => 2 u ,
503- _ => 3 u ,
500+ assert_eq ! ( 3 , match Atom :: from_slice( "zzzzzz" ) {
501+ atom!( br) => 1 ,
502+ atom!( html) | atom!( head) => 2 ,
503+ _ => 3 ,
504504 } ) ;
505505 }
506506}
0 commit comments