Skip to content

Commit

Permalink
Update to rand 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
krant committed Feb 1, 2025
1 parent f7378b2 commit cc184b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ walkdir = { version = "2.3.2", optional = true }

[dependencies]
futures-util = "0.3.28"
rand = "0.8.5"
rand = "0.9.0"
tokio = { version = "1.32.0", features = ["full"] }
tokio-serial = "5.4.4"
tokio-util = "0.7.8"
Expand Down
8 changes: 4 additions & 4 deletions src/utils_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::errors_internal::Error;
use std::time::Duration;
use std::time::UNIX_EPOCH;

use rand::{distributions::Standard, prelude::Distribution, Rng};
use rand::{distr::StandardUniform, prelude::Distribution, Rng};
use tokio_serial::{available_ports, SerialPort, SerialStream};

use crate::connections::stream_api::StreamHandle;
Expand Down Expand Up @@ -224,10 +224,10 @@ pub async fn build_tcp_stream(
///
pub fn generate_rand_id<T>() -> T
where
Standard: Distribution<T>,
StandardUniform: Distribution<T>,
{
let mut rng = rand::thread_rng();
rng.gen::<T>()
let mut rng = rand::rng();
rng.random()
}

/// A helper function that takes a vector of bytes (u8) representing an encoded packet, and
Expand Down

0 comments on commit cc184b4

Please sign in to comment.