fix: Resolve compilation errors with FilterOption and type mismatches

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 09:18:38 -03:00
parent 332a609d7f
commit 5e866c7cbf
4 changed files with 15 additions and 20 deletions

View File

@@ -14,7 +14,6 @@ use prettytable::format::consts::{FORMAT_BOX_CHARS, FORMAT_NO_BORDER_LINE_SEPARA
use crate::meta_plugin::{MetaPluginType, get_meta_plugin};
use crate::common::status::{MetaPluginInfo, CompressionInfo};
use crate::services::filter_service::get_available_filter_plugins;
use prettytable::color;
@@ -145,18 +144,18 @@ fn build_filter_plugin_table(filter_plugins: &Vec<crate::common::status::FilterP
"{}".to_string()
} else {
// Convert options to a map for better display
let options_map: std::collections::BTreeMap<_, _> = plugin_info.options
.iter()
.map(|opt| {
let mut opt_map = std::collections::BTreeMap::new();
opt_map.insert("name", &opt.name);
if let Some(default) = &opt.default {
opt_map.insert("default", default);
}
opt_map.insert("required", &opt.required);
(opt.name.clone(), serde_yaml::Value::String(format!("{:?}", opt_map)))
})
.collect();
let mut options_map = std::collections::BTreeMap::new();
for opt in &plugin_info.options {
let mut opt_map = std::collections::BTreeMap::new();
opt_map.insert("name".to_string(), serde_yaml::Value::String(opt.name.clone()));
if let Some(default) = &opt.default {
opt_map.insert("default".to_string(), serde_yaml::Value::String(format!("{:?}", default)));
} else {
opt_map.insert("default".to_string(), serde_yaml::Value::String("None".to_string()));
}
opt_map.insert("required".to_string(), serde_yaml::Value::String(opt.required.to_string()));
options_map.insert(opt.name.clone(), serde_yaml::Value::String(format!("{:?}", opt_map)));
}
serde_yaml::to_string(&options_map)
.unwrap_or_else(|_| "Unable to serialize options".to_string())
.trim()