treewide: replace std hashers with rustc_hash alternatives; fix clippy

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I766c36cb53d3d7f9e85b91a67c4131a66a6a6964
This commit is contained in:
raf 2026-03-19 22:34:30 +03:00
commit c6efd3661f
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
53 changed files with 343 additions and 394 deletions

View file

@ -3,13 +3,14 @@
// the test suite
#![allow(dead_code)]
use std::{collections::HashMap, path::PathBuf, sync::Arc};
use std::{path::PathBuf, sync::Arc};
use pinakes_core::{
media_type::{BuiltinMediaType, MediaType},
model::{ContentHash, MediaId, MediaItem, StorageMode},
storage::{DynStorageBackend, StorageBackend, sqlite::SqliteBackend},
};
use rustc_hash::FxHashMap;
use tempfile::TempDir;
use uuid::Uuid;
@ -46,7 +47,7 @@ pub fn make_test_media(hash: &str) -> MediaItem {
duration_secs: Some(120.0),
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -83,7 +84,7 @@ pub fn create_test_media_item(path: PathBuf, hash: &str) -> MediaItem {
duration_secs: None,
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -121,7 +122,7 @@ pub fn make_test_markdown_item(id: MediaId) -> MediaItem {
duration_secs: None,
description: Some("Test markdown note".to_string()),
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,

View file

@ -1,6 +1,5 @@
use std::collections::HashMap;
use pinakes_core::{model::*, storage::StorageBackend};
use rustc_hash::FxHashMap;
mod common;
use common::{make_test_media, setup};
@ -28,7 +27,7 @@ async fn test_media_crud() {
duration_secs: None,
description: Some("A test file".to_string()),
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -120,7 +119,7 @@ async fn test_tags() {
duration_secs: Some(180.0),
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -191,7 +190,7 @@ async fn test_collections() {
duration_secs: None,
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -252,7 +251,7 @@ async fn test_custom_fields() {
duration_secs: None,
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -334,7 +333,7 @@ async fn test_search() {
duration_secs: None,
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,
@ -479,7 +478,7 @@ async fn test_library_statistics_with_data() {
duration_secs: Some(120.0),
description: None,
thumbnail_path: None,
custom_fields: HashMap::new(),
custom_fields: FxHashMap::default(),
file_mtime: None,
date_taken: None,
latitude: None,