diff options
Diffstat (limited to 'cli/cache/common.rs')
-rw-r--r-- | cli/cache/common.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/cache/common.rs b/cli/cache/common.rs index 93ff91d50..3e2e862aa 100644 --- a/cli/cache/common.rs +++ b/cli/cache/common.rs @@ -11,6 +11,10 @@ impl FastInsecureHasher { Self::default() } + pub fn hash(hashable: impl std::hash::Hash) -> u64 { + Self::new().write_hashable(hashable).finish() + } + pub fn write_str(&mut self, text: &str) -> &mut Self { self.write(text.as_bytes()); self @@ -33,7 +37,7 @@ impl FastInsecureHasher { pub fn write_hashable( &mut self, - hashable: &impl std::hash::Hash, + hashable: impl std::hash::Hash, ) -> &mut Self { hashable.hash(&mut self.0); self |