diff --git a/Cargo.lock b/Cargo.lock index 34f20b7..be44194 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6191,7 +6191,7 @@ dependencies = [ "log", "mime_guess", "parking_lot 0.12.5", - "rand 0.9.2", + "rand 0.10.2", "route_manager", "rust-embed", "serde", diff --git a/vnt-core/src/context/mod.rs b/vnt-core/src/context/mod.rs index 13c6861..e7e5268 100644 --- a/vnt-core/src/context/mod.rs +++ b/vnt-core/src/context/mod.rs @@ -524,8 +524,8 @@ impl ServerInfoCollection { server_node.client_map.extend(map); } let mut client_simple_map = HashMap::::new(); - for (_, server_node) in guard.iter() { - for (_, x) in server_node.client_map.iter() { + for server_node in guard.values() { + for x in server_node.client_map.values() { if let Some(v) = client_simple_map.get_mut(&x.ip) { if x.online { v.online = true; @@ -555,7 +555,7 @@ impl ServerInfoCollection { } } } else { - for (_, server_node) in guard.iter() { + for server_node in guard.values() { if server_node.connected { return true; } @@ -597,7 +597,7 @@ impl ServerInfoCollection { } pub fn get_server_rtt(&self, ip: &Ipv4Addr) -> Option { let server_node_map_guard = self.server_node_map.read(); - for (_, server_node) in server_node_map_guard.iter() { + for server_node in server_node_map_guard.values() { if !server_node.connected { continue; } diff --git a/vnt-web/Cargo.toml b/vnt-web/Cargo.toml index dd732d6..36a5705 100644 --- a/vnt-web/Cargo.toml +++ b/vnt-web/Cargo.toml @@ -23,4 +23,4 @@ mime_guess = "2.0" parking_lot.workspace = true time = { workspace = true, features = ["local-offset", "formatting", "macros"] } tokio-util.workspace = true -rand = "0.9" +rand = "0.10" diff --git a/vnt-web/src/service_http.rs b/vnt-web/src/service_http.rs index 175ceba..efe93a6 100644 --- a/vnt-web/src/service_http.rs +++ b/vnt-web/src/service_http.rs @@ -13,7 +13,7 @@ use axum::{ use ipnet::Ipv4Net; use mime_guess::from_path; use parking_lot::Mutex; -use rand::Rng; +use rand::RngExt; use rust_embed::RustEmbed; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -849,7 +849,6 @@ async fn start_vnt_internal( let start_config = cfg.clone(); let core_config = convert_config(cfg)?; - let sub_input = core_config.input.clone(); state.record_log(&file_name, "创建异步任务组"); let task_group_manager = state @@ -870,7 +869,6 @@ async fn start_vnt_internal( config_display_name, start_config, core_config, - sub_input, task_group, task_group_guard, ) @@ -894,10 +892,10 @@ async fn start_vnt_network( config_display_name: String, start_config: StartConfig, core_config: CoreConfig, - sub_input: Vec, task_group: vnt_core::utils::task_control::TaskGroup, task_group_guard: vnt_core::utils::task_control::TaskGroupGuard, ) -> anyhow::Result<()> { + let sub_input = core_config.input.clone(); let mut network_manager = NetworkManager::create_network(Box::new(core_config), task_group.clone()) .await