Skip to content

Commit b38b9e1

Browse files
committed
Use if-let rather than map() in parse_logging_spec.
1 parent 294ef5b commit b38b9e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/liblog/directive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec<LogDirective>, Option<String>) {
4646
spec);
4747
return (dirs, None);
4848
}
49-
mods.map(|m| {
49+
if let Some(m) = mods {
5050
for s in m.split(',') {
5151
if s.is_empty() {
5252
continue
@@ -83,7 +83,7 @@ pub fn parse_logging_spec(spec: &str) -> (Vec<LogDirective>, Option<String>) {
8383
level: log_level,
8484
});
8585
}
86-
});
86+
}
8787

8888
(dirs, filter.map(str::to_owned))
8989
}

0 commit comments

Comments
 (0)