Skip to content

Commit 6e94efb

Browse files
ROVER-331 Fix other clippies and deprecated calls
1 parent 0050492 commit 6e94efb

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/composition/supergraph/config/scenario.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ fn graph_id_or_variant() -> String {
2929
const ALPHA_CHARSET: &[u8] = b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
3030
const ADDITIONAL_CHARSET: &[u8] =
3131
b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
32-
let mut rng = rand::thread_rng();
32+
let mut rng = rand::rng();
3333
let mut value = format!(
3434
"{}",
35-
ALPHA_CHARSET[rng.gen_range(0..ALPHA_CHARSET.len())] as char
35+
ALPHA_CHARSET[rng.random_range(0..ALPHA_CHARSET.len())] as char
3636
);
37-
let remaining = rng.gen_range(0..62);
37+
let remaining = rng.random_range(0..62);
3838
for _ in 0..remaining {
39-
let c = ADDITIONAL_CHARSET[rng.gen_range(0..ADDITIONAL_CHARSET.len())] as char;
39+
let c = ADDITIONAL_CHARSET[rng.random_range(0..ADDITIONAL_CHARSET.len())] as char;
4040
value.push(c);
4141
}
4242
value

tests/e2e/subgraph/publish.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ use rstest::rstest;
88
use serde::Deserialize;
99
use speculoos::assert_that;
1010
use speculoos::iter::ContainingIntoIterAssertions;
11-
use tracing::error;
12-
use tracing::info;
11+
use tracing::{error, info};
1312
use tracing_test::traced_test;
1413

15-
use crate::e2e::remote_supergraph_publish_test_variant_graphref;
16-
use crate::e2e::test_artifacts_directory;
14+
use crate::e2e::{remote_supergraph_publish_test_variant_graphref, test_artifacts_directory};
1715

1816
#[derive(Debug, Deserialize)]
1917
struct SubgraphListResponse {
@@ -48,7 +46,7 @@ async fn e2e_test_rover_subgraph_publish(
4846
// I appreciate that in theory it's possible there could be a clash here, however, there are
4947
// 3.2 * 10^115 possibilities for identifiers, so I think for practical purposes we can
5048
// consider these as unique.
51-
let mut rng = rand::thread_rng();
49+
let mut rng = rand::rng();
5250
let id_regex = rand_regex::Regex::compile("[a-zA-Z][a-zA-Z0-9_-]{0,63}", 100)
5351
.expect("Could not compile regex");
5452
let id: String = rng.sample::<String, &rand_regex::Regex>(&id_regex);

0 commit comments

Comments
 (0)