Skip to content

Commit 1fe85aa

Browse files
committed
clippy fixes
1 parent a764728 commit 1fe85aa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

support/macros/src/visitor.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use ahash::RandomState;
2-
use std::hash::{BuildHasher, Hash, Hasher};
32
use syn::{parse_quote, visit_mut::VisitMut};
43

54
pub 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)]

0 commit comments

Comments
 (0)