Skip to content

Commit

Permalink
subscriber: fix clippy::map_flatten lint (#1964)
Browse files Browse the repository at this point in the history
Clippy now warns about code that calls `.map(...).flatten()` on an
iterator and suggests `.flat_map(...)` instead:
https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten

This branch fixes one place where we do that. CI should be happy again.
  • Loading branch information
hawkw committed Feb 28, 2022
1 parent 2586b73 commit 79e19be
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,12 +1092,7 @@ where

ctx.format_fields(writer.by_ref(), event)?;

for span in ctx
.event_scope()
.into_iter()
.map(Scope::from_root)
.flatten()
{
for span in ctx.event_scope().into_iter().flat_map(Scope::from_root) {
let exts = span.extensions();
if let Some(fields) = exts.get::<FormattedFields<N>>() {
if !fields.is_empty() {
Expand Down

0 comments on commit 79e19be

Please sign in to comment.