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:
parent
d73bb4580d
commit
f831e58723
53 changed files with 343 additions and 394 deletions
|
|
@ -1,9 +1,10 @@
|
|||
//! Plugin registry for managing loaded plugins
|
||||
|
||||
use std::{collections::HashMap, path::PathBuf};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
use pinakes_plugin_api::{PluginManifest, PluginMetadata};
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use super::runtime::WasmPlugin;
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ pub struct RegisteredPlugin {
|
|||
/// Plugin registry maintains the state of all loaded plugins
|
||||
pub struct PluginRegistry {
|
||||
/// Map of plugin ID to registered plugin
|
||||
plugins: HashMap<String, RegisteredPlugin>,
|
||||
plugins: FxHashMap<String, RegisteredPlugin>,
|
||||
}
|
||||
|
||||
impl PluginRegistry {
|
||||
|
|
@ -29,7 +30,7 @@ impl PluginRegistry {
|
|||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
plugins: HashMap::new(),
|
||||
plugins: FxHashMap::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -156,9 +157,8 @@ impl Default for PluginRegistry {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::collections::HashMap;
|
||||
|
||||
use pinakes_plugin_api::{Capabilities, manifest::ManifestCapabilities};
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use super::*;
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ mod tests {
|
|||
priority: 0,
|
||||
},
|
||||
capabilities: ManifestCapabilities::default(),
|
||||
config: HashMap::new(),
|
||||
config: FxHashMap::default(),
|
||||
ui: Default::default(),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue