"general" as a header is reserved

This commit is contained in:
Adrian Malacoda 2017-02-26 02:19:46 -06:00
parent d9ab75a607
commit 0a45cbb9f2

View File

@ -33,7 +33,9 @@ impl ModuleLoader {
} }
pub fn load_from_configuration (&self, configuration: Table) -> Result<BTreeMap<String, Box<Module>>, ModuleLoaderError> { pub fn load_from_configuration (&self, configuration: Table) -> Result<BTreeMap<String, Box<Module>>, ModuleLoaderError> {
configuration.into_iter().map(|(key, value)| { configuration.into_iter().filter(|&(ref key, _)| {
key != "general"
}).map(|(key, value)| {
match value.as_table() { match value.as_table() {
Some(table) => { Some(table) => {
let module = self.load_single_module(&key, table)?; let module = self.load_single_module(&key, table)?;