aboutsummaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-01-31 23:57:33 +0100
committerAlex Auvolat <alex@adnab.me>2023-01-31 23:57:33 +0100
commit6df6411b7234c36555e5b38aa7084f641354cce2 (patch)
tree47c439bcc32ea818fcf225c5d63c29ab6fba47af /src/util.rs
parente4c0be848d50c0480fc54c69074bc8b3f88d83bf (diff)
downloadnetapp-6df6411b7234c36555e5b38aa7084f641354cce2.tar.gz
netapp-6df6411b7234c36555e5b38aa7084f641354cce2.zip
fix clippy
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs6
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()?