From: Tobin Harding Date: Wed, 10 Feb 2021 00:36:12 +0000 (+1100) Subject: Use map instead of and_then X-Git-Tag: v0.5.0~10^2~6 X-Git-Url: http://internal-gitweb-vhost/%22https:/parse/database/error/struct.Script.html?a=commitdiff_plain;h=bfe29c4ef60b52a71123274f445205ee01b2504b;p=bdk Use map instead of and_then As suggested by Clippy us `map` instead of `and_then` with an inner option. --- diff --git a/examples/compiler.rs b/examples/compiler.rs index 3b62147c..284aa12e 100644 --- a/examples/compiler.rs +++ b/examples/compiler.rs @@ -97,7 +97,7 @@ fn main() -> Result<(), Box> { let network = matches .value_of("network") - .and_then(|n| Some(Network::from_str(n))) + .map(|n| Network::from_str(n)) .transpose() .unwrap() .unwrap_or(Network::Testnet);