borrow hashmap

master
Ondřej Hruška 5 years ago
parent 8dce05504e
commit 298a219613
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 6
      src/lib.rs

@ -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) /// 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 None
} }
@ -180,8 +180,8 @@ pub trait AppConfig: Sized + Serialize + DeserializeOwned + Debug + Default {
if let Some(mod_levels) = config.logging_mod_levels() { if let Some(mod_levels) = config.logging_mod_levels() {
for (module, lvl) in mod_levels { for (module, lvl) in mod_levels {
let lvl = log::LevelFilter::from_str(lvl.as_ref())?; let lvl = log::LevelFilter::from_str(lvl)?;
builder.filter_module(module.as_ref(), lvl); builder.filter_module(module, lvl);
} }
} }

Loading…
Cancel
Save