actually use pipeline config
Fixes: https://github.com/damus-io/noteguard/issues/4 Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
e1fe57ea87
commit
bae87107ae
1 changed files with 6 additions and 1 deletions
|
|
@ -73,7 +73,12 @@ impl Noteguard {
|
||||||
fn load_config(&mut self, config: &Config) -> Result<(), toml::de::Error> {
|
fn load_config(&mut self, config: &Config) -> Result<(), toml::de::Error> {
|
||||||
self.loaded_filters.clear();
|
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()) {
|
if let Some(constructor) = self.registered_filters.get(name.as_str()) {
|
||||||
let filter = constructor(config_value.clone())?;
|
let filter = constructor(config_value.clone())?;
|
||||||
self.loaded_filters.push(filter);
|
self.loaded_filters.push(filter);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue