File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11use ahash:: RandomState ;
2- use std:: hash:: { BuildHasher , Hash , Hasher } ;
32use syn:: { parse_quote, visit_mut:: VisitMut } ;
43
54pub struct CleanDocComments ;
@@ -29,14 +28,12 @@ pub fn generate_hash<T: Into<syn::Item> + Clone>(item: &T) -> u64 {
2928 const SEED1 : u64 = 0x12345678 ;
3029 const SEED2 : u64 = 0x87654321 ;
3130
32- // Create a RandomState with the fixed seed
31+ // use a fixed seed for predictable hashes
3332 let fixed_state = RandomState :: with_seeds ( SEED1 , SEED2 , SEED1 , SEED2 ) ;
3433
35- // Create a hasher with the fixed seed
36- let mut hasher = fixed_state. build_hasher ( ) ;
34+ // hash item
3735 let item = Into :: < syn:: Item > :: into ( item) ;
38- item. hash ( & mut hasher) ;
39- hasher. finish ( )
36+ fixed_state. hash_one ( & item)
4037}
4138
4239#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments