fix: resolve moved value errors and unused variable warnings
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -153,47 +153,47 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
|
|||||||
Ok(plugin_type) => plugin_type,
|
Ok(plugin_type) => plugin_type,
|
||||||
Err(_) => continue,
|
Err(_) => continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
// First, create a default plugin to get its default options
|
// First, create a default plugin to get its default options
|
||||||
let default_plugin = get_meta_plugin(
|
let default_plugin = get_meta_plugin(
|
||||||
meta_plugin_type,
|
meta_plugin_type.clone(),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Start with the default options
|
// Start with the default options
|
||||||
let mut effective_options = default_plugin.options().clone();
|
let mut effective_options = default_plugin.options().clone();
|
||||||
|
|
||||||
// Merge with the configured options
|
// Merge with the configured options
|
||||||
for (key, value) in &plugin_config.options {
|
for (key, value) in &plugin_config.options {
|
||||||
effective_options.insert(key.clone(), value.clone());
|
effective_options.insert(key.clone(), value.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert outputs from HashMap<String, String> to HashMap<String, serde_yaml::Value>
|
// Convert outputs from HashMap<String, String> to HashMap<String, serde_yaml::Value>
|
||||||
let outputs_converted: std::collections::HashMap<String, serde_yaml::Value> = plugin_config.outputs
|
let outputs_converted: std::collections::HashMap<String, serde_yaml::Value> = plugin_config.outputs
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(k, v)| (k.clone(), serde_yaml::Value::String(v.clone())))
|
.map(|(k, v)| (k.clone(), serde_yaml::Value::String(v.clone())))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Create the actual plugin with merged options
|
// Create the actual plugin with merged options
|
||||||
let actual_plugin = get_meta_plugin(
|
let actual_plugin = get_meta_plugin(
|
||||||
meta_plugin_type,
|
meta_plugin_type.clone(),
|
||||||
Some(effective_options.clone()),
|
Some(effective_options.clone()),
|
||||||
Some(outputs_converted),
|
Some(outputs_converted),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Show the merged options including defaults set by the plugin
|
// Show the merged options including defaults set by the plugin
|
||||||
// Convert options to a YAML string, but handle formatting better
|
// Convert options to a YAML string, but handle formatting better
|
||||||
let mut options_to_serialize = actual_plugin.options().clone();
|
// Note: actual_plugin.options() is not used here, so we don't need to store it
|
||||||
|
|
||||||
// For plugins that set default options programmatically, we need to include them
|
// For plugins that set default options programmatically, we need to include them
|
||||||
// Let's get the default plugin to see what options it would have
|
// Let's get the default plugin to see what options it would have
|
||||||
let default_plugin = get_meta_plugin(
|
let _default_plugin = get_meta_plugin(
|
||||||
meta_plugin_type,
|
meta_plugin_type.clone(),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Use the effective_options which already includes both defaults and configured options
|
// Use the effective_options which already includes both defaults and configured options
|
||||||
let options_str = if effective_options.is_empty() {
|
let options_str = if effective_options.is_empty() {
|
||||||
"{}".to_string()
|
"{}".to_string()
|
||||||
|
|||||||
Reference in New Issue
Block a user