Use map instead of and_then

As suggested by Clippy us `map` instead of `and_then` with an inner
option.
This commit is contained in:
Tobin Harding 2021-02-10 11:36:12 +11:00
parent e35601bb19
commit bfe29c4ef6
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607

View 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);