]> Untitled Git - bdk/commitdiff
Use map instead of and_then
authorTobin Harding <me@tobin.cc>
Wed, 10 Feb 2021 00:36:12 +0000 (11:36 +1100)
committerTobin Harding <me@tobin.cc>
Wed, 24 Feb 2021 02:30:48 +0000 (13:30 +1100)
As suggested by Clippy us `map` instead of `and_then` with an inner
option.

examples/compiler.rs

index 3b62147c2fca84e76eb1b580ac5e1e672ceb99d2..284aa12ecc7dbb05f8072e7030e59ef351c16ddd 100644 (file)
@@ -97,7 +97,7 @@ fn main() -> Result<(), Box<dyn Error>> {
 
     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);