refactor: update meta plugins structure to use map and vector
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -38,21 +38,8 @@ impl StatusService {
|
||||
|
||||
let mut status_info = generate_status_info(data_path, db_path, &meta_plugin_types, enabled_compression_type);
|
||||
|
||||
// Add options to each meta plugin info
|
||||
for meta_plugin_info in &mut status_info.meta_plugins {
|
||||
let meta_plugin_type = MetaPluginType::from_str(&meta_plugin_info.meta_name).unwrap();
|
||||
let plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type, None, None);
|
||||
|
||||
// Convert options to a serializable format
|
||||
let options: std::collections::HashMap<String, serde_yaml::Value> = plugin
|
||||
.options()
|
||||
.iter()
|
||||
.map(|(k, v)| (k.clone(), v.clone()))
|
||||
.collect();
|
||||
|
||||
// Add options to the meta plugin info
|
||||
meta_plugin_info.options = options;
|
||||
}
|
||||
// The options are now populated directly in generate_status_info
|
||||
// No need to modify them here
|
||||
|
||||
status_info
|
||||
}
|
||||
@@ -75,21 +62,8 @@ impl StatusService {
|
||||
|
||||
let mut status_info = generate_status_info(data_path, db_path, &supported_meta_plugins, enabled_compression_type);
|
||||
|
||||
// Add options to each meta plugin info
|
||||
for meta_plugin_info in &mut status_info.meta_plugins {
|
||||
let meta_plugin_type = MetaPluginType::from_str(&meta_plugin_info.meta_name).unwrap();
|
||||
let plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type, None, None);
|
||||
|
||||
// Convert options to a serializable format
|
||||
let options: std::collections::HashMap<String, serde_yaml::Value> = plugin
|
||||
.options()
|
||||
.iter()
|
||||
.map(|(k, v)| (k.clone(), v.clone()))
|
||||
.collect();
|
||||
|
||||
// Add options to the meta plugin info
|
||||
meta_plugin_info.options = options;
|
||||
}
|
||||
// The options are now populated directly in generate_status_info
|
||||
// No need to modify them here
|
||||
|
||||
status_info
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user