feat: use strum to serialize MetaPluginType

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 19:40:29 -03:00
parent 95c79cacf6
commit 1d61ac1243

View File

@@ -32,22 +32,8 @@ 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 // Get the plugin name using strum's Display implementation
let plugin_name = match meta_plugin_type { let plugin_name = meta_plugin_type.to_string();
MetaPluginType::MagicFile => "magic_file",
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",
MetaPluginType::Program => "program",
};
// 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 {