From e4942490ee6f51573223772ceee8a8ac46b55ae6 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 9 Dec 2021 12:20:37 +0100 Subject: [PATCH] Cargo clippy --- src/consul.rs | 2 +- src/main.rs | 2 +- src/proxy_config.rs | 4 ++-- src/reverse_proxy.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/consul.rs b/src/consul.rs index 6750ba0..ee1935c 100644 --- a/src/consul.rs +++ b/src/consul.rs @@ -114,7 +114,7 @@ impl Consul { }; let resp: ConsulNodeCatalog = http.json().await?; - return Ok((resp, new_idx)); + Ok((resp, new_idx)) } // ---- KV get and put ---- diff --git a/src/main.rs b/src/main.rs index faffac6..61fc747 100644 --- a/src/main.rs +++ b/src/main.rs @@ -104,7 +104,7 @@ async fn main() { } } -fn exit_on_err(e: anyhow::Error) -> () { +fn exit_on_err(e: anyhow::Error) { error!("{}", e); std::process::exit(1); } diff --git a/src/proxy_config.rs b/src/proxy_config.rs index 820d40a..deb2ffe 100644 --- a/src/proxy_config.rs +++ b/src/proxy_config.rs @@ -86,10 +86,10 @@ fn retry_to_time(retries: u32, max_time: Duration) -> Duration { // 1.2^x seems to be a good value to exponentially increase time at a good pace // eg. 1.2^32 = 341 seconds ~= 5 minutes - ie. after 32 retries we wait 5 // minutes - return Duration::from_secs(cmp::min( + Duration::from_secs(cmp::min( max_time.as_secs(), 1.2f64.powf(retries as f64) as u64, - )); + )) } fn parse_tricot_tag( diff --git a/src/reverse_proxy.rs b/src/reverse_proxy.rs index 7b0f261..72644b7 100644 --- a/src/reverse_proxy.rs +++ b/src/reverse_proxy.rs @@ -135,7 +135,7 @@ pub async fn call( forward_uri: &str, request: Request, ) -> Result> { - let proxied_request = create_proxied_request(client_ip, &forward_uri, request)?; + let proxied_request = create_proxied_request(client_ip, forward_uri, request)?; trace!("Proxied request: {:?}", proxied_request); @@ -153,7 +153,7 @@ pub async fn call_https( forward_uri: &str, request: Request, ) -> Result> { - let proxied_request = create_proxied_request(client_ip, &forward_uri, request)?; + let proxied_request = create_proxied_request(client_ip, forward_uri, request)?; trace!("Proxied request (HTTPS): {:?}", proxied_request);