1
Fork 0

Use if-let rather than map() in parse_logging_spec.

This commit is contained in:
Ms2ger 2015-10-14 14:16:48 +02:00
parent 294ef5b158
commit b38b9e101a

View file

@ -46,7 +46,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec<LogDirective>, Option<String>) {
spec); spec);
return (dirs, None); return (dirs, None);
} }
mods.map(|m| { if let Some(m) = mods {
for s in m.split(',') { for s in m.split(',') {
if s.is_empty() { if s.is_empty() {
continue continue
@ -83,7 +83,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec<LogDirective>, Option<String>) {
level: log_level, level: log_level,
}); });
} }
}); }
(dirs, filter.map(str::to_owned)) (dirs, filter.map(str::to_owned))
} }