commit bae87107ae0781edd1d1df891e5458000dd3a219
parent e1fe57ea878a7ba6740fca0fefc0d138bec42ad1
Author: William Casarin <jb55@jb55.com>
Date: Tue, 9 Jul 2024 09:43:50 -0700
actually use pipeline config
Fixes: https://github.com/damus-io/noteguard/issues/4
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
@@ -73,7 +73,12 @@ impl Noteguard {
fn load_config(&mut self, config: &Config) -> Result<(), toml::de::Error> {
self.loaded_filters.clear();
- for (name, config_value) in &config.filters {
+ for name in &config.pipeline {
+ let config_value = config
+ .filters
+ .get(name)
+ .unwrap_or_else(|| panic!("could not find filter configuration for {}", name));
+
if let Some(constructor) = self.registered_filters.get(name.as_str()) {
let filter = constructor(config_value.clone())?;
self.loaded_filters.push(filter);