Commit 6e94efb 1 parent 0050492 commit 6e94efb Copy full SHA for 6e94efb
File tree 2 files changed +7
-9
lines changed
src/composition/supergraph/config
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,14 @@ fn graph_id_or_variant() -> String {
29
29
const ALPHA_CHARSET : & [ u8 ] = b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
30
30
const ADDITIONAL_CHARSET : & [ u8 ] =
31
31
b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_" ;
32
- let mut rng = rand:: thread_rng ( ) ;
32
+ let mut rng = rand:: rng ( ) ;
33
33
let mut value = format ! (
34
34
"{}" ,
35
- ALPHA_CHARSET [ rng. gen_range ( 0 ..ALPHA_CHARSET . len( ) ) ] as char
35
+ ALPHA_CHARSET [ rng. random_range ( 0 ..ALPHA_CHARSET . len( ) ) ] as char
36
36
) ;
37
- let remaining = rng. gen_range ( 0 ..62 ) ;
37
+ let remaining = rng. random_range ( 0 ..62 ) ;
38
38
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 ;
40
40
value. push ( c) ;
41
41
}
42
42
value
Original file line number Diff line number Diff line change @@ -8,12 +8,10 @@ use rstest::rstest;
8
8
use serde:: Deserialize ;
9
9
use speculoos:: assert_that;
10
10
use speculoos:: iter:: ContainingIntoIterAssertions ;
11
- use tracing:: error;
12
- use tracing:: info;
11
+ use tracing:: { error, info} ;
13
12
use tracing_test:: traced_test;
14
13
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} ;
17
15
18
16
#[ derive( Debug , Deserialize ) ]
19
17
struct SubgraphListResponse {
@@ -48,7 +46,7 @@ async fn e2e_test_rover_subgraph_publish(
48
46
// I appreciate that in theory it's possible there could be a clash here, however, there are
49
47
// 3.2 * 10^115 possibilities for identifiers, so I think for practical purposes we can
50
48
// consider these as unique.
51
- let mut rng = rand:: thread_rng ( ) ;
49
+ let mut rng = rand:: rng ( ) ;
52
50
let id_regex = rand_regex:: Regex :: compile ( "[a-zA-Z][a-zA-Z0-9_-]{0,63}" , 100 )
53
51
. expect ( "Could not compile regex" ) ;
54
52
let id: String = rng. sample :: < String , & rand_regex:: Regex > ( & id_regex) ;
You can’t perform that action at this time.
0 commit comments