fix: resolve borrowing issue in meta plugin support check

Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-07-29 14:11:01 -03:00
parent 13a2747a8d
commit cae1cfcaf2

View File

@@ -69,13 +69,17 @@ pub fn mode_save(
.collect(); .collect();
// Check for unsupported meta plugins, warn the user, and remove them from the list // Check for unsupported meta plugins, warn the user, and remove them from the list
let mut i = 0;
meta_plugins.retain(|meta_plugin| { meta_plugins.retain(|meta_plugin| {
// We need to get the type somehow, but we can't easily do that from the trait
// So we'll check support and warn if needed
let is_supported = meta_plugin.is_supported(); let is_supported = meta_plugin.is_supported();
if !is_supported { if !is_supported {
eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", meta_plugin.meta_name()); // We need to get the meta name for the warning message
// Since we can't mutably borrow meta_plugin here, we create a temporary one
let meta_plugin_type = meta_plugin_types[i].clone();
let mut temp_plugin = get_meta_plugin(meta_plugin_type);
eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", temp_plugin.meta_name());
} }
i += 1;
is_supported is_supported
}); });