@@ -2,7 +2,7 @@ use goose::prelude::*;
2
2
3
3
use crate :: common;
4
4
5
- use rand:: seq :: SliceRandom ;
5
+ use rand:: prelude :: * ;
6
6
7
7
/// Load the front page in English and all static assets found on the page.
8
8
pub async fn front_page_en ( user : & mut GooseUser ) -> TransactionResult {
@@ -23,7 +23,7 @@ pub async fn recipe_listing_en(user: &mut GooseUser) -> TransactionResult {
23
23
/// Load a random recipe in English and all static assets found on the page.
24
24
pub async fn recipe_en ( user : & mut GooseUser ) -> TransactionResult {
25
25
let nodes = common:: get_nodes ( & common:: ContentType :: Recipe ) ;
26
- let recipe = nodes. choose ( & mut rand:: thread_rng ( ) ) ;
26
+ let recipe = nodes. choose ( & mut rand:: rng ( ) ) ;
27
27
let goose = user. get ( recipe. unwrap ( ) . url_en ) . await ?;
28
28
common:: validate_and_load_static_assets ( user, goose, recipe. unwrap ( ) . title_en ) . await ?;
29
29
@@ -41,7 +41,7 @@ pub async fn article_listing_en(user: &mut GooseUser) -> TransactionResult {
41
41
/// Load a random article in English and all static assets found on the page.
42
42
pub async fn article_en ( user : & mut GooseUser ) -> TransactionResult {
43
43
let nodes = common:: get_nodes ( & common:: ContentType :: Article ) ;
44
- let article = nodes. choose ( & mut rand:: thread_rng ( ) ) ;
44
+ let article = nodes. choose ( & mut rand:: rng ( ) ) ;
45
45
let goose = user. get ( article. unwrap ( ) . url_en ) . await ?;
46
46
common:: validate_and_load_static_assets ( user, goose, article. unwrap ( ) . title_en ) . await ?;
47
47
@@ -51,7 +51,7 @@ pub async fn article_en(user: &mut GooseUser) -> TransactionResult {
51
51
/// Load a random basic page in English and all static assets found on the page.
52
52
pub async fn basic_page_en ( user : & mut GooseUser ) -> TransactionResult {
53
53
let nodes = common:: get_nodes ( & common:: ContentType :: BasicPage ) ;
54
- let page = nodes. choose ( & mut rand:: thread_rng ( ) ) ;
54
+ let page = nodes. choose ( & mut rand:: rng ( ) ) ;
55
55
let goose = user. get ( page. unwrap ( ) . url_en ) . await ?;
56
56
common:: validate_and_load_static_assets ( user, goose, page. unwrap ( ) . title_en ) . await ?;
57
57
@@ -66,10 +66,10 @@ pub async fn page_by_nid(user: &mut GooseUser) -> TransactionResult {
66
66
common:: ContentType :: BasicPage ,
67
67
common:: ContentType :: Recipe ,
68
68
] ;
69
- let content_type = content_types. choose ( & mut rand:: thread_rng ( ) ) ;
69
+ let content_type = content_types. choose ( & mut rand:: rng ( ) ) ;
70
70
// Then randomly select a node of this content type.
71
71
let nodes = common:: get_nodes ( content_type. unwrap ( ) ) ;
72
- let page = nodes. choose ( & mut rand:: thread_rng ( ) ) ;
72
+ let page = nodes. choose ( & mut rand:: rng ( ) ) ;
73
73
// Load the page by nid instead of by URL.
74
74
let goose = user
75
75
. get ( & ( "/node/" . to_string ( ) + & page. unwrap ( ) . nid . to_string ( ) ) )
@@ -96,7 +96,7 @@ pub async fn search_en(user: &mut GooseUser) -> TransactionResult {
96
96
/// Load category listing by a random term in English and all static assets found on the page.
97
97
pub async fn term_listing_en ( user : & mut GooseUser ) -> TransactionResult {
98
98
let terms = common:: get_terms ( ) ;
99
- let term = terms. choose ( & mut rand:: thread_rng ( ) ) ;
99
+ let term = terms. choose ( & mut rand:: rng ( ) ) ;
100
100
let goose = user. get ( term. unwrap ( ) . url_en ) . await ?;
101
101
common:: validate_and_load_static_assets ( user, goose, term. unwrap ( ) . title_en ) . await ?;
102
102
0 commit comments