diff --git a/Cargo.toml b/Cargo.toml index 9d91caf..a6446fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" version = "0.3.6" -edition = "2021" +edition = "2024" license = "MIT" readme = "README.md" keywords = ["dns", "dyndns", "dynamic-ip"] diff --git a/src/auth.rs b/src/auth.rs index c0156d0..1731ddc 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -1,5 +1,5 @@ -use base64::engine::general_purpose::URL_SAFE_NO_PAD; use base64::Engine; +use base64::engine::general_purpose::URL_SAFE_NO_PAD; use tower_http::validate_request::ValidateRequestHeaderLayer; use tracing::{trace, warn}; diff --git a/src/main.rs b/src/main.rs index f7e6fcb..bd7aa91 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,17 +6,17 @@ use std::{ }; use axum::{ + Router, extract::{Query, State}, routing::get, - Router, }; use axum_client_ip::ClientIp; -use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; +use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD}; use clap::{Parser, Subcommand}; use clap_verbosity_flag::Verbosity; use config::Config; use http::StatusCode; -use miette::{bail, ensure, Context, IntoDiagnostic, Result}; +use miette::{Context, IntoDiagnostic, Result, bail, ensure}; use tracing::{debug, error, info}; use tracing_subscriber::EnvFilter; @@ -121,7 +121,7 @@ impl SavedIPs { } } - fn ips(&self) -> impl Iterator { + fn ips(&self) -> impl Iterator + use<> { self.ipv4 .map(IpAddr::V4) .into_iter() @@ -215,7 +215,7 @@ fn load_ip(path: &Path) -> Result> { _ => Err(err).into_diagnostic().wrap_err_with(|| { format!("failed to load last ip address from {}", path.display()) }), - } + }; } }; diff --git a/src/nsupdate.rs b/src/nsupdate.rs index 5d266b9..eeacc93 100644 --- a/src/nsupdate.rs +++ b/src/nsupdate.rs @@ -103,7 +103,7 @@ mod test { use insta::assert_snapshot; - use super::{update_ns_records, Action}; + use super::{Action, update_ns_records}; use crate::DEFAULT_TTL; #[test] diff --git a/src/records.rs b/src/records.rs index 9c5158c..4e2b832 100644 --- a/src/records.rs +++ b/src/records.rs @@ -1,6 +1,6 @@ //! Deal with the DNS records -use miette::{ensure, miette, LabeledSpan, Result}; +use miette::{LabeledSpan, Result, ensure, miette}; pub fn validate_record_str(record: &str) -> Result<()> { validate_line(0, record).map_err(|err| err.with_source_code(String::from(record)))