diff --git a/Cargo.lock b/Cargo.lock index 4e3f958..2198165 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,7 +28,6 @@ dependencies = [ "glob", "log", "mime_guess", - "once_cell", "percent-encoding", "rcgen", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 1dd91fe..bae113e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ getopts = "0.2.21" glob = "0.3" log = "0.4" mime_guess = "2.0" -once_cell = "1.20" percent-encoding = "2.3" rcgen = { version = "0.13.1", default-features = false, features = ["ring"] } tokio-rustls = { version = "0.26.0", default-features = false, features = ["logging", "ring", "tls12"] } diff --git a/src/main.rs b/src/main.rs index af1f974..d6a1d0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use codes::*; use metadata::{FileOptions, PresetMeta}; use { - once_cell::sync::Lazy, percent_encoding::{percent_decode_str, percent_encode, AsciiSet, CONTROLS}, rcgen::{CertificateParams, DnType, KeyPair}, std::{ @@ -19,7 +18,7 @@ use { io::Write as _, net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}, path::{self, Component, Path, PathBuf}, - sync::Arc, + sync::{Arc, LazyLock}, }, tokio::{ io::{AsyncReadExt, AsyncWriteExt}, @@ -153,7 +152,7 @@ fn main() { type Result> = std::result::Result; -static ARGS: Lazy = Lazy::new(|| { +static ARGS: LazyLock = LazyLock::new(|| { args().unwrap_or_else(|s| { eprintln!("{s}"); std::process::exit(1); @@ -409,7 +408,7 @@ fn check_path(s: String) -> Result { } /// TLS configuration. -static TLS: Lazy = Lazy::new(acceptor); +static TLS: LazyLock = LazyLock::new(acceptor); fn acceptor() -> TlsAcceptor { let config = if ARGS.only_tls13 {