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

@ -4,12 +4,10 @@
//! Plugins can extend Pinakes by implementing one or more of the provided
//! traits.
use std::{
collections::HashMap,
path::{Path, PathBuf},
};
use std::path::{Path, PathBuf};
use async_trait::async_trait;
use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@ -74,7 +72,7 @@ pub struct PluginContext {
pub cache_dir: PathBuf,
/// Plugin configuration from manifest
pub config: HashMap<String, serde_json::Value>,
pub config: FxHashMap<String, serde_json::Value>,
/// Capabilities granted to the plugin
pub capabilities: Capabilities,
@ -160,7 +158,7 @@ pub struct PluginMetadata {
pub struct HealthStatus {
pub healthy: bool,
pub message: Option<String>,
pub metrics: HashMap<String, f64>,
pub metrics: FxHashMap<String, f64>,
}
/// Trait for plugins that provide custom media type support
@ -227,7 +225,7 @@ pub struct ExtractedMetadata {
pub bitrate_kbps: Option<u32>,
/// Custom metadata fields specific to this file type
pub custom_fields: HashMap<String, serde_json::Value>,
pub custom_fields: FxHashMap<String, serde_json::Value>,
/// Tags extracted from the file
pub tags: Vec<String>,
@ -301,14 +299,14 @@ pub struct SearchIndexItem {
pub content: Option<String>,
pub tags: Vec<String>,
pub media_type: String,
pub metadata: HashMap<String, serde_json::Value>,
pub metadata: FxHashMap<String, serde_json::Value>,
}
/// Search query
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SearchQuery {
pub query_text: String,
pub filters: HashMap<String, serde_json::Value>,
pub filters: FxHashMap<String, serde_json::Value>,
pub limit: usize,
pub offset: usize,
}
@ -360,7 +358,7 @@ pub enum EventType {
pub struct Event {
pub event_type: EventType,
pub timestamp: String,
pub data: HashMap<String, serde_json::Value>,
pub data: FxHashMap<String, serde_json::Value>,
}
/// Trait for plugins that provide UI themes
@ -387,7 +385,7 @@ pub struct ThemeDefinition {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Theme {
pub id: String,
pub colors: HashMap<String, String>,
pub fonts: HashMap<String, String>,
pub colors: FxHashMap<String, String>,
pub fonts: FxHashMap<String, String>,
pub custom_css: Option<String>,
}