diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.rs b/src/util.rs index 4676e64..edf8c49 100644 --- a/src/util.rs +++ b/src/util.rs @@ -62,7 +62,7 @@ pub fn watch_ctrl_c() -> watch::Receiver<bool> { pub fn parse_peer_addr(peer: &str) -> Option<(NodeID, SocketAddr)> { let delim = peer.find('@')?; let (key, ip) = peer.split_at(delim); - let pubkey = NodeID::from_slice(&hex::decode(&key).ok()?)?; + let pubkey = NodeID::from_slice(&hex::decode(key).ok()?)?; let ip = ip[1..].parse::<SocketAddr>().ok()?; Some((pubkey, ip)) } @@ -74,7 +74,7 @@ pub fn parse_and_resolve_peer_addr(peer: &str) -> Option<(NodeID, Vec<SocketAddr let delim = peer.find('@')?; let (key, host) = peer.split_at(delim); - let pubkey = NodeID::from_slice(&hex::decode(&key).ok()?)?; + let pubkey = NodeID::from_slice(&hex::decode(key).ok()?)?; let hosts = host[1..].to_socket_addrs().ok()?.collect::<Vec<_>>(); if hosts.is_empty() { return None; @@ -86,7 +86,7 @@ pub fn parse_and_resolve_peer_addr(peer: &str) -> Option<(NodeID, Vec<SocketAddr pub async fn parse_and_resolve_peer_addr_async(peer: &str) -> Option<(NodeID, Vec<SocketAddr>)> { let delim = peer.find('@')?; let (key, host) = peer.split_at(delim); - let pubkey = NodeID::from_slice(&hex::decode(&key).ok()?)?; + let pubkey = NodeID::from_slice(&hex::decode(key).ok()?)?; let hosts = tokio::net::lookup_host(&host[1..]) .await .ok()? |