Skip to content

Commit

Permalink
Update to rand 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Feb 2, 2025
1 parent 649b97a commit ca32312
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ http-body-util = "0.1"
hyper = "1"
hyper-util = { version = "0.1", features = ["server-auto", "tokio"] }
log = "0.4"
rand = "0.8"
rand = "0.9"
regex = "1.7"
serde_json = "1.0"
serde_urlencoded = "0.7"
Expand Down
6 changes: 3 additions & 3 deletions src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::Request;
use crate::{Error, ErrorKind};
use bytes::Bytes;
use http::{HeaderMap, HeaderName, StatusCode};
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use rand::distr::Alphanumeric;
use rand::Rng;
use std::convert::Into;
use std::fmt;
use std::io;
Expand Down Expand Up @@ -153,7 +153,7 @@ impl Mock {
assert_on_drop: bool,
) -> Mock {
let inner = InnerMock {
id: thread_rng()
id: rand::rng()
.sample_iter(&Alphanumeric)
.map(char::from)
.take(24)
Expand Down
4 changes: 2 additions & 2 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extern crate serde_json;

use mockito::{Matcher, Server, ServerOpts};
use rand::distributions::Alphanumeric;
use rand::distr::Alphanumeric;
use rand::Rng;
use std::fmt::Display;
use std::fs;
Expand Down Expand Up @@ -1017,7 +1017,7 @@ fn test_all_of_missing_match_header() {
#[test]
fn test_large_utf8_body() {
let mut s = Server::new();
let mock_body: String = rand::thread_rng()
let mock_body: String = rand::rng()
.sample_iter(&Alphanumeric)
.map(char::from)
.take(3 * 1024) // Must be larger than the request read buffer
Expand Down

0 comments on commit ca32312

Please sign in to comment.