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"]
[dependencies]
reqwest = { version = "0.11", features = ["json"] }
reqwest = { version = "0.12", features = ["json"] }
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
@ -19,10 +19,10 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
clap = { version = "4", features = ["derive", "cargo"] }
anyhow = "1"
toml = "0.7"
tabled = { version = "0.13", features = ["derive"] }
toml = "0.8"
tabled = { version = "0.17", features = ["derive"] }
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"
[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> {
let file = File::options()
.create(true)
.truncate(false)
.read(true)
.write(true)
.open(path)
@ -303,7 +304,7 @@ fn load_ip_cache<P: AsRef<Path> + Debug>(path: P) -> Result<CacheFile> {
#[instrument(level = "debug", ret)]
fn ip_cache_path(cache_dir: Option<PathBuf>) -> Result<PathBuf> {
cache_dir
.or(dirs::cache_dir())
.or_else(dirs::cache_dir)
.context("Failed to determine cache directory")
.map(|path| path.join("cloudflare-ddns.cache"))
}