diff options
author | Alex Auvolat <alex@adnab.me> | 2023-01-26 17:26:32 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-01-26 17:26:32 +0100 |
commit | 8e93d6997415d60ba5c371da8b27065a57254a8c (patch) | |
tree | 8bf3c182ca5d70bd242cc691d2b1fee65c8b6cd3 /src/rpc | |
parent | 3113f6b5f2a688a3f7c4f933774866f48618f7d1 (diff) | |
download | garage-8e93d6997415d60ba5c371da8b27065a57254a8c.tar.gz garage-8e93d6997415d60ba5c371da8b27065a57254a8c.zip |
More clippy fixes
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/consul.rs | 2 | ||||
-rw-r--r-- | src/rpc/system.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/consul.rs b/src/rpc/consul.rs index b1772a1a..f85f789c 100644 --- a/src/rpc/consul.rs +++ b/src/rpc/consul.rs @@ -113,7 +113,7 @@ impl ConsulDiscovery { let pubkey = ent .node_meta .get("pubkey") - .and_then(|k| hex::decode(&k).ok()) + .and_then(|k| hex::decode(k).ok()) .and_then(|k| NodeID::from_slice(&k[..])); if let (Some(ip), Some(pubkey)) = (ip, pubkey) { ret.push((pubkey, SocketAddr::new(ip, ent.service_port))); diff --git a/src/rpc/system.rs b/src/rpc/system.rs index e0ced8cc..b42e49fc 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -215,7 +215,7 @@ pub fn gen_node_key(metadata_dir: &Path) -> Result<NodeKey, Error> { } else { if !metadata_dir.exists() { info!("Metadata directory does not exist, creating it."); - std::fs::create_dir(&metadata_dir)?; + std::fs::create_dir(metadata_dir)?; } info!("Generating new node key pair."); @@ -419,7 +419,7 @@ impl System { .get(&n.id.into()) .cloned() .map(|(_, st)| st) - .unwrap_or(NodeStatus::unknown()), + .unwrap_or_else(NodeStatus::unknown), }) .collect::<Vec<_>>(); known_nodes |