From 64d7bdce16ae5a6d83cc290551b42574db177193 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Mon, 5 Sep 2022 12:18:30 +0200 Subject: [PATCH] Remove redundant `is_none()` check We don't need to check the same iterator twice. And, as at this point pubkey will always be `Some(..)`, we don't need to check it either. We therefore can just remove the first part of the condition. --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 013209f..5863ed0 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -762,7 +762,7 @@ pub(crate) fn parse_peer_info( let mut pubkey_and_addr = peer_pubkey_and_ip_addr.split("@"); let pubkey = pubkey_and_addr.next(); let peer_addr_str = pubkey_and_addr.next(); - if peer_addr_str.is_none() || peer_addr_str.is_none() { + if peer_addr_str.is_none() { return Err(std::io::Error::new( std::io::ErrorKind::Other, "ERROR: incorrectly formatted peer info. Should be formatted as: `pubkey@host:port`", -- 2.39.5