]> Untitled Git - bdk/commitdiff
Use .flatten() instead of .filter_map(|x| x), clippy warning
authorSteve Myers <steve@notmandatory.org>
Thu, 8 Apr 2021 20:37:59 +0000 (13:37 -0700)
committerSteve Myers <steve@notmandatory.org>
Thu, 8 Apr 2021 21:18:07 +0000 (14:18 -0700)
https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity

src/descriptor/policy.rs

index c8df81f57a4c0d80c06153fea660de0e64e072b6..f387fea86e4288429685edca58cfb2416273cfe2 100644 (file)
@@ -870,7 +870,7 @@ impl<Ctx: ScriptContext> ExtractPolicy for Miniscript<DescriptorPublicKey, Ctx>
                     .map(|n| n.extract_policy(signers, secp))
                     .collect::<Result<Vec<_>, _>>()?
                     .into_iter()
-                    .filter_map(|x| x)
+                    .flatten()
                     .collect();
 
                 if mapped.len() < nodes.len() {