fix: replace to_string with explicit plugin name mapping

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-27 10:50:38 -03:00
parent 0ed7e3aae7
commit 539f99f803

View File

@@ -32,8 +32,26 @@ impl MetaService {
.map(|meta_plugin_type| { .map(|meta_plugin_type| {
debug!("META_SERVICE: Creating plugin: {:?}", meta_plugin_type); debug!("META_SERVICE: Creating plugin: {:?}", meta_plugin_type);
// Get the plugin name to find its configuration using the Display trait // Get the plugin name to find its configuration
let plugin_name = meta_plugin_type.to_string().to_lowercase(); let plugin_name = match meta_plugin_type {
MetaPluginType::FileMagic => "file_magic",
MetaPluginType::FileMime => "file_mime",
MetaPluginType::FileEncoding => "file_encoding",
MetaPluginType::MagicFile => "magic_file",
MetaPluginType::LineCount => "line_count",
MetaPluginType::WordCount => "word_count",
MetaPluginType::Cwd => "cwd",
MetaPluginType::Binary => "binary",
MetaPluginType::Text => "text",
MetaPluginType::User => "user",
MetaPluginType::Shell => "shell",
MetaPluginType::ShellPid => "shell_pid",
MetaPluginType::KeepPid => "keep_pid",
MetaPluginType::Digest => "digest",
MetaPluginType::ReadTime => "read_time",
MetaPluginType::ReadRate => "read_rate",
MetaPluginType::Hostname => "hostname",
};
// Get options and outputs from settings // Get options and outputs from settings
let (options, outputs) = if let Some(meta_plugin_configs) = &settings.meta_plugins { let (options, outputs) = if let Some(meta_plugin_configs) = &settings.meta_plugins {