mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(span): use Hasher from std (#5476)
Use `std:#️⃣:Hasher` instead of `core:#️⃣:Hasher`. I don't actually know if importing `core` as well as `std` has any compile time perf impact, but as we're using `std` anyway, we may as well use it for everything. Import into the `auto_impl_content_hash` module to make the macro a little easier to read.
This commit is contained in:
parent
bd820f9c16
commit
94a6ac63cf
1 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use core::hash::Hasher;
|
||||
use std::{
|
||||
hash::Hash,
|
||||
hash::{Hash, Hasher},
|
||||
mem::{discriminant, Discriminant},
|
||||
};
|
||||
|
||||
|
|
@ -53,11 +52,12 @@ impl<'a, T: ContentHash> ContentHash for oxc_allocator::Vec<'a, T> {
|
|||
|
||||
mod auto_impl_content_hash {
|
||||
use super::ContentHash;
|
||||
|
||||
macro_rules! impl_content_hash {
|
||||
($($t:ty)*) => {
|
||||
$(
|
||||
impl ContentHash for $t {
|
||||
fn content_hash<H: core::hash::Hasher>(&self, state: &mut H) {
|
||||
fn content_hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
std::hash::Hash::hash(self, state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue