From 5e857201216677c51d85fc38af72605f066a5bb2 Mon Sep 17 00:00:00 2001 From: Marsel Shaikhin Date: Sun, 5 May 2024 21:16:06 +0200 Subject: [PATCH] chore: change default file hasher to fxhash --- crates/fervid/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fervid/src/lib.rs b/crates/fervid/src/lib.rs index 42f1187..81ad999 100644 --- a/crates/fervid/src/lib.rs +++ b/crates/fervid/src/lib.rs @@ -59,10 +59,10 @@ use fervid_parser::SfcParser; use fervid_transform::{style::should_transform_style_block, transform_sfc, TransformSfcOptions}; use std::{ borrow::Cow, - collections::hash_map::DefaultHasher, hash::{Hash, Hasher}, }; use swc_core::ecma::ast::Expr; +use fxhash::FxHasher32; // TODO Add severity to errors // TODO Better structs @@ -130,7 +130,7 @@ pub fn compile(source: &str, options: CompileOptions) -> Result Result // For scopes let file_hash = { - let mut hasher = DefaultHasher::default(); + let mut hasher = FxHasher32::default(); source.hash(&mut hasher); let num = hasher.finish(); format!("{:x}", num)