fix: Use FromStr trait for MetaPluginType parsing

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-03 08:53:06 -03:00
parent 738af256b0
commit de6c4d0c07

View File

@@ -1,6 +1,7 @@
use clap::*; use clap::*;
use is_terminal::IsTerminal; use is_terminal::IsTerminal;
use std::path::PathBuf; use std::path::PathBuf;
use std::str::FromStr;
use log::debug; use log::debug;
use crate::modes::common::OutputFormat; use crate::modes::common::OutputFormat;
@@ -39,7 +40,7 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
for plugin_config in sorted_meta_plugins { for plugin_config in sorted_meta_plugins {
// Create the plugin to get its default options // Create the plugin to get its default options
let meta_plugin_type = match plugin_config.name.parse() { let meta_plugin_type = match MetaPluginType::from_str(&plugin_config.name) {
Ok(plugin_type) => plugin_type, Ok(plugin_type) => plugin_type,
Err(_) => continue, Err(_) => continue,
}; };
@@ -176,7 +177,7 @@ fn build_meta_plugin_table(meta_plugin_info: &std::collections::HashMap<String,
for info in sorted_meta_plugin_info { for info in sorted_meta_plugin_info {
// Get default options for the meta plugin // Get default options for the meta plugin
let meta_plugin_type = match info.meta_name.parse() { let meta_plugin_type = match MetaPluginType::from_str(&info.meta_name) {
Ok(plugin_type) => plugin_type, Ok(plugin_type) => plugin_type,
Err(_) => continue, Err(_) => continue,
}; };