From 8dd9d5f5239f9f842f7096a540f866bd4f10b72c Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 10 Jul 2023 17:45:09 -0400 Subject: refactor(lsp): move config file related code to config.rs (#19790) Will make #19788 easier. --- cli/cache/common.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cli/cache/common.rs') 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 -- cgit v1.2.3