ModulesManager #37

Merged
modulatingforce merged 22 commits from modulesmanager into main 2024-03-22 21:34:08 -04:00
Showing only changes of commit 072903882d - Show all commits

View file

@ -272,11 +272,22 @@ pub async fn init(mgr: Arc<ModulesManager>) {
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
// #[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, Hash, Clone)]
pub enum ModType {
BotModule(String),
}
impl PartialEq for ModType {
fn eq(&self, other: &Self) -> bool {
let BotModule(name1) = self.clone();
let BotModule(name2) = other.clone();
name1.to_lowercase() == name2.to_lowercase()
}
}
impl Eq for ModType {}
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub enum ModGroup {
Core,
@ -1287,10 +1298,10 @@ mod core_modulesmanager {
use super::*;
#[test]
fn WIP_case_insensitive_test() {
fn case_insensitive_test() {
Log::set_file_ext(Extension::Log);
assert_eq!(
BotModule("test".to_string()),
BotModule("Test".to_string()),
BotModule("Test".to_lowercase())
);
}