Deduplicate plugins by name, with later entries (higher priority) winning. Since plugins are added in low-to-high priority order, we reverse, deduplicate (keeping first occurrence), then restore order.
(plugins: Vec<String>)
| 1232 | /// Since plugins are added in low-to-high priority order, |
| 1233 | /// we reverse, deduplicate (keeping first occurrence), then restore order. |
| 1234 | pub fn deduplicate_plugins(plugins: Vec<String>) -> Vec<String> { |
| 1235 | let mut seen = std::collections::HashSet::new(); |
| 1236 | let mut unique: Vec<String> = Vec::new(); |
| 1237 | |
| 1238 | for specifier in plugins.iter().rev() { |
| 1239 | let name = get_plugin_name(specifier); |
| 1240 | if seen.insert(name) { |
| 1241 | unique.push(specifier.clone()); |
| 1242 | } |
| 1243 | } |
| 1244 | |
| 1245 | unique.reverse(); |
| 1246 | unique |
| 1247 | } |
| 1248 | |
| 1249 | /// Apply post-load transforms: legacy migrations, flag overrides, plugin dedup. |
| 1250 | fn apply_post_load_transforms(config: &mut Config) { |
no test coverage detected