Skip to content

Commit da4e922

Browse files
committed
Update to rand 0.9
1 parent 8b8fc34 commit da4e922

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ http-body-util = "0.1"
2828
hyper = "1"
2929
hyper-util = { version = "0.1", features = ["server-auto", "tokio"] }
3030
log = "0.4"
31-
rand = "0.8"
31+
rand = "0.9"
3232
regex = "1.7"
3333
serde_json = "1.0"
3434
serde_urlencoded = "0.7"

src/mock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::Request;
77
use crate::{Error, ErrorKind};
88
use bytes::Bytes;
99
use http::{HeaderMap, HeaderName, StatusCode};
10-
use rand::distributions::Alphanumeric;
11-
use rand::{thread_rng, Rng};
10+
use rand::distr::Alphanumeric;
11+
use rand::Rng;
1212
use std::convert::Into;
1313
use std::fmt;
1414
use std::io;
@@ -153,7 +153,7 @@ impl Mock {
153153
assert_on_drop: bool,
154154
) -> Mock {
155155
let inner = InnerMock {
156-
id: thread_rng()
156+
id: rand::rng()
157157
.sample_iter(&Alphanumeric)
158158
.map(char::from)
159159
.take(24)

tests/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
extern crate serde_json;
33

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

0 commit comments

Comments
 (0)