From 665ca419d5173981b0e0c4868126ac9589506596 Mon Sep 17 00:00:00 2001 From: aumetra Date: Sat, 2 Dec 2023 12:28:25 +0100 Subject: [PATCH] Use `ahash` --- Cargo.lock | 1 + kitsune/Cargo.toml | 1 + kitsune/src/http/handler/public.rs | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96bab80ff..d3a543739 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2762,6 +2762,7 @@ dependencies = [ name = "kitsune" version = "0.0.1-pre.4" dependencies = [ + "ahash 0.8.6", "argon2", "askama", "askama_axum", diff --git a/kitsune/Cargo.toml b/kitsune/Cargo.toml index 6424e56c7..6b13f42f7 100644 --- a/kitsune/Cargo.toml +++ b/kitsune/Cargo.toml @@ -7,6 +7,7 @@ homepage = "https://joinkitsune.org" build = "build.rs" [dependencies] +ahash = "0.8.6" athena = { path = "../lib/athena" } argon2 = { version = "0.5.2", features = ["std"] } askama = { version = "0.12.1", features = [ diff --git a/kitsune/src/http/handler/public.rs b/kitsune/src/http/handler/public.rs index 22169287b..f4f34434b 100644 --- a/kitsune/src/http/handler/public.rs +++ b/kitsune/src/http/handler/public.rs @@ -1,3 +1,4 @@ +use ahash::AHashMap; use axum::{extract::Path, routing, Router, TypedHeader}; use axum_extra::either::Either; use headers::ContentType; @@ -5,10 +6,10 @@ use http::StatusCode; use include_dir::include_dir; use mime::Mime; use once_cell::sync::Lazy; -use std::{collections::HashMap, path::Path as FsPath, sync::RwLock}; +use std::{path::Path as FsPath, sync::RwLock}; static PUBLIC_DIR: include_dir::Dir<'_> = include_dir!("public"); -static PUBLIC_DIR_MIME_TYPE: Lazy>> = +static PUBLIC_DIR_MIME_TYPE: Lazy>> = Lazy::new(RwLock::default); #[allow(clippy::unused_async)]