From a2b27012a5e7e312345afc2d79ba995af9f5e68b Mon Sep 17 00:00:00 2001 From: Antony Nyagah Date: Wed, 9 Oct 2024 07:33:36 +0300 Subject: [PATCH] clippy: Use `flat_map` instead of `map` in `components/devtools` (#33724) * clippy: fix rewrite filter_map with map warning in `components/devtools/actors/inspector/page_style.rs` Signed-off-by: Antony Nyagah * clippy: Use `flat_map` instead `map` in `components/devtools` Signed-off-by: Antony Nyagah --------- Signed-off-by: Antony Nyagah --- components/devtools/actors/inspector/page_style.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/devtools/actors/inspector/page_style.rs b/components/devtools/actors/inspector/page_style.rs index 3d93d25879b..a6d6e9c3be9 100644 --- a/components/devtools/actors/inspector/page_style.rs +++ b/components/devtools/actors/inspector/page_style.rs @@ -151,7 +151,7 @@ impl PageStyleActor { ) .unwrap_or_default() .into_iter() - .filter_map(|node| { + .flat_map(|node| { let inherited = (node.actor != target).then(|| node.actor.clone()); let node_actor = registry.find::(&node.actor); @@ -207,9 +207,8 @@ impl PageStyleActor { inherited: inherited.clone(), }) }); - Some(entries) + entries }) - .flatten() .collect(); let msg = GetAppliedReply { entries,