diff --git a/src/modes/save.rs b/src/modes/save.rs index f7d5f2f..660e967 100644 --- a/src/modes/save.rs +++ b/src/modes/save.rs @@ -64,16 +64,20 @@ pub fn mode_save( // Initialize meta_plugins with MetaPlugin instances for each MetaPluginType let mut meta_plugins: Vec> = meta_plugin_types - .into_iter() - .map(|meta_plugin_type| get_meta_plugin(meta_plugin_type)) + .iter() + .map(|meta_plugin_type| get_meta_plugin(meta_plugin_type.clone())) .collect(); - // Check for unsupported meta plugins and warn the user - for (meta_plugin, meta_plugin_type) in meta_plugins.iter().zip(&meta_plugin_types) { - if !meta_plugin.is_supported() { - eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", meta_plugin_type); + // Check for unsupported meta plugins, warn the user, and remove them from the list + 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(); + if !is_supported { + eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", meta_plugin.meta_name()); } - } + is_supported + }); let mut item = db::Item { id: None,