From 5e274f428bb10c8f44d9d775f185c46dc627c9e5 Mon Sep 17 00:00:00 2001 From: ShuiRuTian <158983297@qq.com> Date: Fri, 10 May 2024 14:37:08 +0800 Subject: [PATCH] use const_hex to replace hex --- Cargo.toml | 2 +- src/index.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 37eb9dd..d41414d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ async-std = { version = "1.10.0", features = ["unstable"], optional = true } digest = "0.10.6" either = "1.6.1" futures = { version = "0.3.17", optional = true } -hex = "0.4.3" +const-hex = "1.0.0" memmap2 = { version = "0.5.8", optional = true } miette = "5.7.0" reflink-copy = "0.1.9" diff --git a/src/index.rs b/src/index.rs index b9f5257..8fc21c2 100644 --- a/src/index.rs +++ b/src/index.rs @@ -309,13 +309,13 @@ fn bucket_path(cache: &Path, key: &str) -> PathBuf { fn hash_key(key: &str) -> String { let mut hasher = Sha1::new(); hasher.update(key); - hex::encode(hasher.finalize()) + const_hex::encode(hasher.finalize()) } fn hash_entry(key: &str) -> String { let mut hasher = Sha256::new(); hasher.update(key); - hex::encode(hasher.finalize()) + const_hex::encode(hasher.finalize()) } fn now() -> u128 {