@@ -38,8 +38,7 @@ fn parse_optimization_types(s: &str) -> Result<OptLevel, ParsingOptLevelError> {
3838 "O2" => Ok ( OptLevel :: Speed ) ,
3939 "Os" => Ok ( OptLevel :: SpeedAndSize ) ,
4040 _ => Err ( ParsingOptLevelError :: Parsing ( format ! (
41- "Invalid optimization type {}" ,
42- s
41+ "Invalid optimization type {s}"
4342 ) ) ) ,
4443 }
4544}
@@ -207,7 +206,7 @@ impl State {
207206 newfolder. display( )
208207 )
209208 } ) ?;
210- println ! ( "Artifacts saved at {:?}" , newfolder ) ;
209+ println ! ( "Artifacts saved at {newfolder :?}" ) ;
211210 Ok ( newfolder)
212211 } )
213212 . collect :: < anyhow:: Result < Vec < _ > > > ( ) ?;
@@ -260,7 +259,7 @@ impl State {
260259 format ! ( "File name could not be retrieved for {}" , name. display( ) )
261260 } ) ?;
262261
263- println ! ( "Input wasm \" {:?}\" " , filename ) ;
262+ println ! ( "Input wasm \" {filename :?}\" " ) ;
264263 let artifacts_folder = self
265264 . get_parent_folders ( name. clone ( ) ) ?
266265 . join ( "artifacts" )
@@ -358,7 +357,7 @@ impl State {
358357 ) -> anyhow:: Result < ( ) > {
359358 let mut hashes = HashMap :: new ( ) ;
360359 //let low_hashes = HashMap::new();
361- let objfolder = artifact_folder. join ( "obj" ) . join ( format ! ( "{:?}" , optlevel ) ) ;
360+ let objfolder = artifact_folder. join ( "obj" ) . join ( format ! ( "{optlevel :?}" ) ) ;
362361 let entries = std:: fs:: read_dir ( & objfolder)
363362 . with_context ( || format ! ( "failed to read dir {}" , objfolder. display( ) ) ) ?;
364363
@@ -393,7 +392,7 @@ impl State {
393392
394393 fn compile_and_save ( & self , worklist : & [ PathBuf ] , artifact_folder : & Path ) -> anyhow:: Result < ( ) > {
395394 for ( _, config) in & self . engines {
396- let newfolder = artifact_folder. join ( "obj" ) . join ( format ! ( "{:?}" , config ) ) ;
395+ let newfolder = artifact_folder. join ( "obj" ) . join ( format ! ( "{config :?}" ) ) ;
397396 std:: fs:: create_dir_all ( & newfolder) . with_context ( || {
398397 format ! (
399398 "Artifacts folder {} could not be created" ,
@@ -423,8 +422,8 @@ impl State {
423422
424423 let filename = artifact_folder
425424 . join ( "obj" )
426- . join ( format ! ( "{:?}" , optlevel ) )
427- . join ( format ! ( "{}.obj" , entryidx ) ) ;
425+ . join ( format ! ( "{optlevel :?}" ) )
426+ . join ( format ! ( "{entryidx }.obj" ) ) ;
428427 std:: fs:: write ( & filename, & obj)
429428 . context ( "Aot file could be written to filesystem" ) ?;
430429 }
@@ -456,15 +455,15 @@ impl State {
456455 while !finish_writing_wrap_clone. load ( Relaxed ) {
457456 // pop from worklist
458457 if let Some ( wasm) = to_write_clone. lock ( ) . unwrap ( ) . pop ( ) {
459- let filename = artifact_folder_cp. join ( format ! ( "mutated.{}.wasm" , counter ) ) ;
458+ let filename = artifact_folder_cp. join ( format ! ( "mutated.{counter }.wasm" ) ) ;
460459 std:: fs:: write ( filename, & wasm) . context ( "Failed to write mutated wasm" ) ?;
461460 counter += 1 ;
462461 }
463462 }
464463 eprintln ! ( "Writing down pending mutated binaries!" ) ;
465464 // Then write pending wasms
466465 while let Some ( wasm) = to_write_clone. lock ( ) . unwrap ( ) . pop ( ) {
467- let filename = artifact_folder_cp. join ( format ! ( "mutated.{}.wasm" , counter ) ) ;
466+ let filename = artifact_folder_cp. join ( format ! ( "mutated.{counter }.wasm" ) ) ;
468467
469468 std:: fs:: write ( filename, & wasm) . context ( "Failed to write mutated wasm" ) ?;
470469 counter += 1 ;
@@ -493,12 +492,12 @@ impl State {
493492 let data_clone = wasm. clone ( ) ;
494493 panic:: set_hook ( Box :: new ( move |panic_info| {
495494 // invoke the default handler and exit the process
496- println ! ( "Internal unhandled panic:\n {:?}!" , panic_info ) ;
495+ println ! ( "Internal unhandled panic:\n {panic_info :?}!" ) ;
497496 // stop generator
498497 finish_writing_wrap_clone2. store ( true , SeqCst ) ;
499498 // report current crash
500499 if let Err ( e) = self_clone. save_crash ( & data_clone, None , seed, & artifact_clone) {
501- eprintln ! ( "Failed to save crash: {}" , e ) ;
500+ eprintln ! ( "Failed to save crash: {e}" ) ;
502501 }
503502 process:: exit ( 1 ) ;
504503 } ) ) ;
@@ -578,14 +577,14 @@ impl State {
578577 format ! ( "Crash folder could not be created {}" , newfolder. display( ) )
579578 } ) ?;
580579
581- let newfile = newfolder. join ( format ! ( "{}.original.wasm" , seed ) ) ;
580+ let newfile = newfolder. join ( format ! ( "{seed }.original.wasm" ) ) ;
582581
583582 std:: fs:: write ( & newfile, wasm) ?;
584583
585584 // Saving the mutation if one
586585
587586 if let Some ( mutated) = mutated {
588- let newfile = newfolder. join ( format ! ( "{}.mutated.wasm" , seed ) ) ;
587+ let newfile = newfolder. join ( format ! ( "{seed }.mutated.wasm" ) ) ;
589588 std:: fs:: write ( newfile, mutated) ?;
590589 }
591590
0 commit comments