From b38b9e101a8bb60fb8c6b257b091c8d23d1b2017 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 14 Oct 2015 14:16:48 +0200 Subject: [PATCH] Use if-let rather than map() in parse_logging_spec. --- src/liblog/directive.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/liblog/directive.rs b/src/liblog/directive.rs index 12a5c131170..3958969cfca 100644 --- a/src/liblog/directive.rs +++ b/src/liblog/directive.rs @@ -46,7 +46,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec, Option) { spec); return (dirs, None); } - mods.map(|m| { + if let Some(m) = mods { for s in m.split(',') { if s.is_empty() { continue @@ -83,7 +83,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec, Option) { level: log_level, }); } - }); + } (dirs, filter.map(str::to_owned)) }