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 committed 2021-02-24 13:30:48 +11:00
1 parent e35601bb19
commit bfe29c4ef6
1 file changed
+1 -1
+1 -1
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);