Update deps; run clippy

This commit is contained in:
Edward Shen 2024-12-04 23:30:24 -08:00
parent 514f83f90c
commit ae5a5b84b9
Signed by: edward
GPG key ID: 19182661E818369F
3 changed files with 996 additions and 459 deletions

1444
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ categories = ["command-line-utilities"]
include = ["src/**/*", "LICENSE", "README.md"] include = ["src/**/*", "LICENSE", "README.md"]
[dependencies] [dependencies]
reqwest = { version = "0.11", features = ["json"] } reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
tracing = "0.1" tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] }
@ -19,10 +19,10 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
clap = { version = "4", features = ["derive", "cargo"] } clap = { version = "4", features = ["derive", "cargo"] }
anyhow = "1" anyhow = "1"
toml = "0.7" toml = "0.8"
tabled = { version = "0.13", features = ["derive"] } tabled = { version = "0.17", features = ["derive"] }
url = { version = "2", features = ["serde"] } url = { version = "2", features = ["serde"] }
lettre = { version = "0.10", default_features = false, features = ["serde"] } lettre = { version = "0.11", default-features = false, features = ["serde"] }
dirs = "5" dirs = "5"
[profile.release] [profile.release]

View file

@ -286,6 +286,7 @@ struct CacheFile(HashMap<String, IpAddr>);
fn load_ip_cache<P: AsRef<Path> + Debug>(path: P) -> Result<CacheFile> { fn load_ip_cache<P: AsRef<Path> + Debug>(path: P) -> Result<CacheFile> {
let file = File::options() let file = File::options()
.create(true) .create(true)
.truncate(false)
.read(true) .read(true)
.write(true) .write(true)
.open(path) .open(path)
@ -303,7 +304,7 @@ fn load_ip_cache<P: AsRef<Path> + Debug>(path: P) -> Result<CacheFile> {
#[instrument(level = "debug", ret)] #[instrument(level = "debug", ret)]
fn ip_cache_path(cache_dir: Option<PathBuf>) -> Result<PathBuf> { fn ip_cache_path(cache_dir: Option<PathBuf>) -> Result<PathBuf> {
cache_dir cache_dir
.or(dirs::cache_dir()) .or_else(dirs::cache_dir)
.context("Failed to determine cache directory") .context("Failed to determine cache directory")
.map(|path| path.join("cloudflare-ddns.cache")) .map(|path| path.join("cloudflare-ddns.cache"))
} }