@@ -15,8 +15,6 @@ use std::{
1515 sync:: { Arc , Mutex } ,
1616} ;
1717
18- #[ cfg( feature = "test" ) ]
19- use rand:: { thread_rng, Rng } ;
2018use tracing_subscriber:: util:: SubscriberInitExt ;
2119
2220pub mod filesource;
@@ -287,7 +285,6 @@ pub struct TestProcess {
287285 pub cwd : PathBuf ,
288286 pub args : Vec < String > ,
289287 pub vars : HashMap < String , String > ,
290- pub id : u64 ,
291288 pub stdin : filesource:: TestStdinInner ,
292289 pub stdout : filesource:: TestWriterInner ,
293290 pub stderr : filesource:: TestWriterInner ,
@@ -305,20 +302,12 @@ impl TestProcess {
305302 cwd : cwd. as_ref ( ) . to_path_buf ( ) ,
306303 args : args. iter ( ) . map ( |s| s. as_ref ( ) . to_string ( ) ) . collect ( ) ,
307304 vars,
308- id : TestProcess :: new_id ( ) ,
309305 stdin : Arc :: new ( Mutex :: new ( Cursor :: new ( stdin. to_string ( ) ) ) ) ,
310306 stdout : Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ,
311307 stderr : Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ,
312308 }
313309 }
314310
315- fn new_id ( ) -> u64 {
316- let low_bits: u64 = std:: process:: id ( ) as u64 ;
317- let mut rng = thread_rng ( ) ;
318- let high_bits = rng. gen_range ( 0 ..u32:: MAX ) as u64 ;
319- high_bits << 32 | low_bits
320- }
321-
322311 /// Extracts the stdout from the process
323312 pub fn get_stdout ( & self ) -> Vec < u8 > {
324313 self . stdout
0 commit comments