11use libtest_lexarg:: OutputFormat ;
22
3- use crate :: * ;
3+ use crate :: { Case , RunError , RunMode , State , cli , notify , shuffle } ;
44
55pub struct Harness {
66 raw : Vec < std:: ffi:: OsString > ,
@@ -33,7 +33,7 @@ impl Harness {
3333 pub fn main ( mut self ) -> ! {
3434 let mut parser = cli:: Parser :: new ( & self . raw ) ;
3535 let opts = parse ( & mut parser) . unwrap_or_else ( |err| {
36- eprintln ! ( "{}" , err ) ;
36+ eprintln ! ( "{err}" ) ;
3737 std:: process:: exit ( 1 )
3838 } ) ;
3939
@@ -45,11 +45,11 @@ impl Harness {
4545 . write_global ( ) ;
4646
4747 let mut notifier = notifier ( & opts) . unwrap_or_else ( |err| {
48- eprintln ! ( "{}" , err ) ;
48+ eprintln ! ( "{err}" ) ;
4949 std:: process:: exit ( 1 )
5050 } ) ;
5151 discover ( & opts, & mut self . cases , notifier. as_mut ( ) ) . unwrap_or_else ( |err| {
52- eprintln ! ( "{}" , err ) ;
52+ eprintln ! ( "{err}" ) ;
5353 std:: process:: exit ( 1 )
5454 } ) ;
5555
@@ -70,7 +70,7 @@ impl Harness {
7070
7171const ERROR_EXIT_CODE : i32 = 101 ;
7272
73- fn parse ( parser : & mut cli:: Parser ) -> cli:: Result < libtest_lexarg:: TestOpts > {
73+ fn parse ( parser : & mut cli:: Parser < ' _ > ) -> cli:: Result < libtest_lexarg:: TestOpts > {
7474 let mut test_opts = libtest_lexarg:: TestOptsParseState :: new ( ) ;
7575
7676 let bin = parser. bin ( ) ;
@@ -194,7 +194,7 @@ fn discover(
194194 retain_cases. push ( retain_case) ;
195195 notifier. notify ( notify:: Event :: DiscoverCase {
196196 name : case. name ( ) . to_owned ( ) ,
197- mode : notify :: RunMode :: Test ,
197+ mode : RunMode :: Test ,
198198 run : retain_case,
199199 } ) ?;
200200 }
@@ -253,8 +253,8 @@ fn run(
253253 "`--test` and `-bench` are mutually exclusive" ,
254254 ) ) ;
255255 }
256- ( true , false ) => notify :: RunMode :: Test ,
257- ( false , true ) => notify :: RunMode :: Bench ,
256+ ( true , false ) => RunMode :: Test ,
257+ ( false , true ) => RunMode :: Bench ,
258258 ( false , false ) => unreachable ! ( "libtest-lexarg` should always ensure at least one is set" ) ,
259259 } ;
260260 state. set_mode ( mode) ;
@@ -309,7 +309,7 @@ fn run(
309309 let case = remaining. pop_front ( ) . unwrap ( ) ;
310310 let name = case. name ( ) . to_owned ( ) ;
311311
312- let cfg = std:: thread:: Builder :: new ( ) . name ( name. to_owned ( ) ) ;
312+ let cfg = std:: thread:: Builder :: new ( ) . name ( name. clone ( ) ) ;
313313 let tx = tx. clone ( ) ;
314314 let case = std:: sync:: Arc :: new ( case) ;
315315 let case_fallback = case. clone ( ) ;
@@ -402,7 +402,7 @@ fn run_case(
402402
403403 let msg = match payload {
404404 Some ( payload) => format ! ( "test panicked: {payload}" ) ,
405- None => "test panicked" . to_string ( ) ,
405+ None => "test panicked" . to_owned ( ) ,
406406 } ;
407407 Err ( RunError :: fail ( msg) )
408408 } ) ;
@@ -412,7 +412,7 @@ fn run_case(
412412 let message = err. and_then ( |e| e. cause ( ) . map ( |c| c. to_string ( ) ) ) ;
413413 notifier. notify ( notify:: Event :: CaseComplete {
414414 name : case. name ( ) . to_owned ( ) ,
415- mode : notify :: RunMode :: Test ,
415+ mode : RunMode :: Test ,
416416 status,
417417 message,
418418 elapsed_s : Some ( notify:: Elapsed ( timer. elapsed ( ) ) ) ,
0 commit comments