55
66use console:: Style ;
77use libc:: STDIN_FILENO ;
8- use libc:: { close , dup , dup2 , pipe , STDERR_FILENO , STDOUT_FILENO } ;
8+ use libc:: { STDERR_FILENO , STDOUT_FILENO , close , dup , dup2 , pipe } ;
99use pretty_print:: {
1010 print_diff, print_end_with_status, print_or_empty, print_section, print_with_style,
1111} ;
12- use rand:: prelude:: IndexedRandom ;
1312use rand:: Rng ;
13+ use rand:: prelude:: IndexedRandom ;
1414use std:: env:: temp_dir;
1515use std:: ffi:: OsString ;
1616use std:: fs:: File ;
1717use std:: io:: { Seek , SeekFrom , Write } ;
1818use std:: os:: fd:: { AsRawFd , RawFd } ;
1919use std:: process:: { Command , Stdio } ;
2020use std:: sync:: atomic:: Ordering ;
21- use std:: sync:: { atomic:: AtomicBool , Once } ;
21+ use std:: sync:: { Once , atomic:: AtomicBool } ;
2222use std:: { io, thread} ;
2323
2424pub mod pretty_print;
@@ -132,6 +132,8 @@ where
132132 let ( uumain_exit_status, captured_stdout, captured_stderr) = thread:: scope ( |s| {
133133 let out = s. spawn ( || read_from_fd ( pipe_stdout_fds[ 0 ] ) ) ;
134134 let err = s. spawn ( || read_from_fd ( pipe_stderr_fds[ 0 ] ) ) ;
135+ #[ allow( clippy:: unnecessary_to_owned) ]
136+ // TODO: clippy wants us to use args.iter().cloned() ?
135137 let status = uumain_function ( args. to_owned ( ) . into_iter ( ) ) ;
136138 // Reset the exit code global variable in case we run another test after this one
137139 // See https://github.com/uutils/coreutils/issues/5777
@@ -406,6 +408,7 @@ pub fn generate_random_string(max_length: usize) -> String {
406408 result
407409}
408410
411+ #[ allow( dead_code) ]
409412pub fn generate_random_file ( ) -> Result < String , std:: io:: Error > {
410413 let mut rng = rand:: rng ( ) ;
411414 let file_name: String = ( 0 ..10 )
@@ -426,6 +429,7 @@ pub fn generate_random_file() -> Result<String, std::io::Error> {
426429 Ok ( file_path. to_str ( ) . unwrap ( ) . to_string ( ) )
427430}
428431
432+ #[ allow( dead_code) ]
429433pub fn replace_fuzz_binary_name ( cmd : & str , result : & mut CommandResult ) {
430434 let fuzz_bin_name = format ! ( "fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_{cmd}" ) ;
431435
0 commit comments