From 298a21961364f7c75722adfa62536ef9d13cb647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 20 Apr 2020 09:20:17 +0200 Subject: [PATCH] borrow hashmap --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e7ed7e6..f3d9ac4 100644 --- a/src/lib.rs +++ b/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) - fn logging_mod_levels(&self) -> Option> { + fn logging_mod_levels(&self) -> Option<&HashMap> { 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); } }