diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-07-10 17:45:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 21:45:09 +0000 |
commit | 8dd9d5f5239f9f842f7096a540f866bd4f10b72c (patch) | |
tree | 159ea977036a2ed76ce61d3ba2da9239a6f287a3 /cli/cache/common.rs | |
parent | 629d09b149ab42cc4c3cebc41e0f23112ace891c (diff) |
refactor(lsp): move config file related code to config.rs (#19790)
Will make #19788 easier.
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 |