From 00916c9eb8f6dc6c6d4e110586eebce76a418030 Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:08:39 +0800 Subject: [PATCH] update rand to 0.9 --- Cargo.toml | 2 +- src/dns.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9a6cdb0..6e20672 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ env_logger = "0.11" hickory-proto = "0.24" log = "0.4" moka = { version = "0.12", default-features = false, features = ["future"] } -rand = "0.8" +rand = "0.9" socks5-impl = { version = "0.6", default-features = false, features = [ "client", ] } diff --git a/src/dns.rs b/src/dns.rs index 6c69066..04eb094 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -7,12 +7,11 @@ use std::{net::IpAddr, str::FromStr}; #[allow(dead_code)] pub fn build_dns_query(domain: &str, query_type: RecordType, used_by_tcp: bool) -> std::io::Result> { - use rand::{rngs::StdRng, Rng, SeedableRng}; let name = Name::from_str(domain).map_err(|e| Error::new(ErrorKind::InvalidInput, e.to_string()))?; let query = Query::query(name, query_type); let mut msg = Message::new(); msg.add_query(query) - .set_id(StdRng::from_entropy().gen()) + .set_id(rand::Rng::random::(&mut rand::rng())) .set_op_code(OpCode::Query) .set_message_type(MessageType::Query) .set_recursion_desired(true);