borrow hashmap

This commit is contained in:
2020-04-20 09:20:17 +02:00
parent 8dce05504e
commit 298a219613
+3 -3
View File
@@ -26,7 +26,7 @@ pub trait AppConfig: Sized + Serialize + DeserializeOwned + Debug + Default {
}
/// Get log module levels to use (take priority over the main log level)
fn logging_mod_levels(&self) -> Option<HashMap<String, String>> {
fn logging_mod_levels(&self) -> Option<&HashMap<String, String>> {
None
}
@@ -180,8 +180,8 @@ pub trait AppConfig: Sized + Serialize + DeserializeOwned + Debug + Default {
if let Some(mod_levels) = config.logging_mod_levels() {
for (module, lvl) in mod_levels {
let lvl = log::LevelFilter::from_str(lvl.as_ref())?;
builder.filter_module(module.as_ref(), lvl);
let lvl = log::LevelFilter::from_str(lvl)?;
builder.filter_module(module, lvl);
}
}