mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 18:58:41 +00:00
Track hashes for file contents
This commit is contained in:
parent
580b8dab1a
commit
793396c624
2 changed files with 28 additions and 12 deletions
|
@ -22,6 +22,10 @@ pub fn is_ci() -> bool {
|
|||
option_env!("CI").is_some()
|
||||
}
|
||||
|
||||
pub fn hash_once<Hasher: std::hash::Hasher + Default>(thing: impl std::hash::Hash) -> u64 {
|
||||
std::hash::BuildHasher::hash_one(&std::hash::BuildHasherDefault::<Hasher>::default(), thing)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[allow(clippy::print_stderr)]
|
||||
pub fn timeit(label: &'static str) -> impl Drop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue