From ac114c73738db94a7f9eb0d2ee5e91221e75e998 Mon Sep 17 00:00:00 2001 From: ppom Date: Mon, 9 Feb 2026 12:00:00 +0100 Subject: [PATCH] fix: merge plugins in configuration --- src/concepts/config.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/concepts/config.rs b/src/concepts/config.rs index ebac704..3080a74 100644 --- a/src/concepts/config.rs +++ b/src/concepts/config.rs @@ -49,6 +49,20 @@ fn dot() -> String { impl Config { fn merge(&mut self, mut other: Config) -> Result<(), String> { + for (key, plugin) in other.plugins.into_iter() { + match self.plugins.entry(key) { + Entry::Vacant(e) => { + e.insert(plugin); + } + Entry::Occupied(e) => { + return Err(format!( + "plugin {} is already defined. plugin definitions can't be spread accross multiple files.", + e.key() + )); + } + } + } + for (key, pattern) in other.patterns.into_iter() { match self.patterns.entry(key) { Entry::Vacant(e) => {