From 639b5cf89f343f0d82f20bb6f1138db45324beb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 20:58:40 +0100 Subject: [PATCH] fix(clippy): enable more lints and fix issues We also add some more metadata to the Cargo.toml manifest --- Cargo.toml | 10 ++++++++++ src/main.rs | 11 ++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cf93cf8..4067e58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,16 @@ description = "An HTTP server using HTTP basic auth to make secure calls to nsup name = "webnsupdate" version = "0.3.2-dev" edition = "2021" +license-file = "LICENSE" +readme = "README.md" +keywords = ["dns", "dyndns", "dynamic-ip"] +categories = ["networking", "dns", "dyndns"] +repository = "https://github.com/jalil-salame/webnsupdate" + +[lints.clippy] +cargo = { level = "warn", priority = -2 } +multiple_crate_versions = "allow" +pedantic = { level = "warn", priority = -1 } [dependencies] axum = "0.7" diff --git a/src/main.rs b/src/main.rs index 07c06f5..b1b7d89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,7 @@ struct Opts { /// Set client IP source /// - /// see: https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.SecureClientIpSource.html + /// see: #[clap(long, default_value = "RightmostXForwardedFor")] ip_source: SecureClientIpSource, @@ -281,12 +281,9 @@ fn main() -> Result<()> { } } } - Ok(None) => { - info!("No previous IP address set"); - } - Err(err) => { - error!("Failed to load last ip address: {err}") - } + Ok(None) => info!("No previous IP address set"), + + Err(err) => error!("Failed to load last ip address: {err}"), }; // Create services