Skip to content

Commit

Permalink
build(deps): update rand requirement from 0.8.5 to 0.9.0 (#373)
Browse files Browse the repository at this point in the history
* build(deps): update rand requirement from 0.8.5 to 0.9.0

Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](rust-random/rand@0.8.5...0.8.5)

---
updated-dependencies:
- dependency-name: rand
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: reduce warnings

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 王宇逸 <Strawberry_Str@hotmail.com>
  • Loading branch information
dependabot[bot] and Berrysoft authored Jan 30, 2025
1 parent a145757 commit 235d824
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ nix = "0.29.0"
once_cell = "1.18.0"
os_pipe = "1.1.4"
paste = "1.0.14"
rand = "0.8.5"
rand = "0.9.0"
rustls = { version = "0.23.1", default-features = false }
rustls-native-certs = "0.8.0"
slab = "0.4.9"
Expand Down
4 changes: 2 additions & 2 deletions compio-quic/benches/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
use compio_buf::bytes::Bytes;
use criterion::{Bencher, BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use futures_util::{StreamExt, stream::FuturesUnordered};
use rand::{RngCore, thread_rng};
use rand::{RngCore, rng};

criterion_group!(quic, echo);
criterion_main!(quic);
Expand Down Expand Up @@ -168,7 +168,7 @@ const DATA_SIZES: &[usize] = &[1, 10, 1024, 1200, 1024 * 16, 1024 * 128];
const STREAMS: &[usize] = &[1, 10, 100];

fn echo(c: &mut Criterion) {
let mut rng = thread_rng();
let mut rng = rng();

let mut data = vec![0u8; *DATA_SIZES.last().unwrap()];
rng.fill_bytes(&mut data);
Expand Down
10 changes: 5 additions & 5 deletions compio/benches/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use compio_buf::{IntoInner, IoBuf};
use compio_io::{AsyncReadAt, AsyncWriteAt};
use criterion::{Bencher, Criterion, Throughput, criterion_group, criterion_main};
use futures_util::{StreamExt, stream::FuturesUnordered};
use rand::{Rng, RngCore, thread_rng};
use rand::{Rng, RngCore, rng};
use tempfile::NamedTempFile;
use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt};

Expand Down Expand Up @@ -202,7 +202,7 @@ fn read_all_monoio(b: &mut Bencher, (path, len): &(&Path, u64)) {
fn read(c: &mut Criterion) {
const FILE_SIZE: u64 = 1024;

let mut rng = thread_rng();
let mut rng = rng();

let mut file = NamedTempFile::new().unwrap();
for _i in 0..FILE_SIZE {
Expand All @@ -215,7 +215,7 @@ fn read(c: &mut Criterion) {

let mut offsets = vec![];
for _i in 0..64 {
let offset = rng.gen_range(0u64..FILE_SIZE) * BUFFER_SIZE as u64;
let offset = rng.random_range(0u64..FILE_SIZE) * BUFFER_SIZE as u64;
offsets.push(offset);
}

Expand Down Expand Up @@ -512,7 +512,7 @@ fn write(c: &mut Criterion) {
const FILE_SIZE: u64 = 1024;
const WRITE_FILE_SIZE: u64 = 16;

let mut rng = thread_rng();
let mut rng = rng();

let mut file = NamedTempFile::new().unwrap();
for _i in 0..FILE_SIZE {
Expand All @@ -528,7 +528,7 @@ fn write(c: &mut Criterion) {

let mut offsets = vec![];
for _i in 0..64 {
let offset = rng.gen_range(0u64..FILE_SIZE) * BUFFER_SIZE as u64;
let offset = rng.random_range(0u64..FILE_SIZE) * BUFFER_SIZE as u64;
offsets.push(offset);
}

Expand Down
4 changes: 2 additions & 2 deletions compio/benches/net.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{net::Ipv4Addr, rc::Rc, time::Instant};

use criterion::{Bencher, Criterion, Throughput, criterion_group, criterion_main};
use rand::{RngCore, thread_rng};
use rand::{RngCore, rng};

#[cfg(target_os = "linux")]
mod monoio_wrap;
Expand Down Expand Up @@ -284,7 +284,7 @@ fn echo_monoio_unix(b: &mut Bencher, content: &[u8; BUFFER_SIZE]) {
}

fn echo(c: &mut Criterion) {
let mut rng = thread_rng();
let mut rng = rng();

let mut content = [0u8; BUFFER_SIZE];
rng.fill_bytes(&mut content);
Expand Down

0 comments on commit 235d824

Please sign in to comment.