diff --git a/Cargo.lock b/Cargo.lock index 24792cd94..ac62ecb11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3385,9 +3385,9 @@ dependencies = [ [[package]] name = "state" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" dependencies = [ "loom", ] diff --git a/clash_lib/Cargo.toml b/clash_lib/Cargo.toml index 2efb498dc..13a59d6f3 100644 --- a/clash_lib/Cargo.toml +++ b/clash_lib/Cargo.toml @@ -21,8 +21,8 @@ async-recursion = "1" ipnet = "2.5" url = "2.2" regex = "1" -state = "0.5" byteorder = "1.5" +state = "0.6" lru_time_cache = "0.11" hyper = { version = "0.14", features = ["http1","http2","client", "server", "tcp"] } http = { version = "0.2" } diff --git a/clash_lib/src/lib.rs b/clash_lib/src/lib.rs index 9274d3385..46ad15842 100644 --- a/clash_lib/src/lib.rs +++ b/clash_lib/src/lib.rs @@ -1,6 +1,5 @@ #[macro_use] extern crate anyhow; -extern crate core; use crate::app::dispatcher::Dispatcher; use crate::app::dns; @@ -18,7 +17,7 @@ use common::http::new_http_client; use common::mmdb; use config::def::LogLevel; use proxy::tun::get_tun_runner; -use state::Storage; +use state::InitCell; use std::io; use std::path::PathBuf; use tokio::task::JoinHandle; @@ -87,7 +86,7 @@ pub struct RuntimeController { shutdown_tx: mpsc::Sender<()>, } -static RUNTIME_CONTROLLER: Storage> = Storage::new(); +static RUNTIME_CONTROLLER: InitCell> = InitCell::new(); pub fn start(opts: Options) -> Result<(), Error> { let rt = match opts.rt.as_ref().unwrap_or(&TokioRuntime::MultiThread) {