@@ -54,7 +54,7 @@ pub fn partition_alignments(
5454 let file = File :: open ( path) . map_err ( |e| {
5555 io:: Error :: new (
5656 io:: ErrorKind :: NotFound ,
57- format ! ( "Could not open starting sequences file {}: {}" , path , e ) ,
57+ format ! ( "Could not open starting sequences file {path }: {e}" ) ,
5858 )
5959 } ) ?;
6060
@@ -75,8 +75,7 @@ pub fn partition_alignments(
7575 starting_sequences. push ( ( seq_id, 0 , seq_length) ) ;
7676 } else if debug {
7777 debug ! (
78- "Sequence {} from starting file not found in index" ,
79- trimmed_name
78+ "Sequence {trimmed_name} from starting file not found in index"
8079 ) ;
8180 }
8281 }
@@ -316,14 +315,14 @@ pub fn partition_alignments(
316315 ( total_partitioned_length as f64 / total_sequence_length as f64 ) * 100.0 ;
317316 // Create formatted percentage strings with conditional scientific notation
318317 let current_percentage_str = if current_percentage < 0.0001 {
319- format ! ( "{:.4e}%" , current_percentage )
318+ format ! ( "{current_percentage :.4e}%" )
320319 } else {
321- format ! ( "{:.4}%" , current_percentage )
320+ format ! ( "{current_percentage :.4}%" )
322321 } ;
323322 let total_percentage_str = if total_percentage < 0.0001 {
324- format ! ( "{:.4e}%" , total_percentage )
323+ format ! ( "{total_percentage :.4e}%" )
325324 } else {
326- format ! ( "{:.4}%" , total_percentage )
325+ format ! ( "{total_percentage :.4}%" )
327326 } ;
328327 //let calc_time = calc_start.elapsed();
329328
@@ -372,7 +371,7 @@ pub fn partition_alignments(
372371 _ => {
373372 return Err ( io:: Error :: new (
374373 io:: ErrorKind :: InvalidInput ,
375- format ! ( "Unsupported output format: {}" , output_format ) ,
374+ format ! ( "Unsupported output format: {output_format}" ) ,
376375 ) ) ;
377376 }
378377 }
@@ -392,7 +391,7 @@ pub fn partition_alignments(
392391 _ => {
393392 return Err ( io:: Error :: new (
394393 io:: ErrorKind :: InvalidInput ,
395- format ! ( "Unsupported output format: {}" , output_format ) ,
394+ format ! ( "Unsupported output format: {output_format}" ) ,
396395 ) ) ;
397396 }
398397 }
@@ -452,7 +451,7 @@ pub fn partition_alignments(
452451 . try_for_each ( |partition_idx| -> io:: Result < ( ) > {
453452 let temp_bed_file = create_output_path (
454453 output_folder,
455- & format ! ( "partition{}.bed.tmp" , partition_idx ) ,
454+ & format ! ( "partition{partition_idx }.bed.tmp" ) ,
456455 ) ?;
457456
458457 // Read intervals from temporary BED file using parse_bed_file
@@ -503,14 +502,13 @@ pub fn partition_alignments(
503502 let final_percentage = ( total_partitioned_length as f64 / total_sequence_length as f64 ) * 100.0 ;
504503 // Create formatted percentage string with conditional scientific notation
505504 let final_percentage_str = if final_percentage < 0.0001 {
506- format ! ( "{:.4e}%" , final_percentage )
505+ format ! ( "{final_percentage :.4e}%" )
507506 } else {
508- format ! ( "{:.4}%" , final_percentage )
507+ format ! ( "{final_percentage :.4}%" )
509508 } ;
510509
511510 info ! (
512- "Partitioned into {} regions: {} bp total written / {} bp total sequence ({})" ,
513- partition_num, total_partitioned_length, total_sequence_length, final_percentage_str
511+ "Partitioned into {partition_num} regions: {total_partitioned_length} bp total written / {total_sequence_length} bp total sequence ({final_percentage_str})"
514512 ) ;
515513
516514 Ok ( ( ) )
@@ -588,8 +586,7 @@ fn select_and_window_sequences(
588586 let seq_name = impg. seq_index . get_name ( seq_id) . unwrap ( ) ;
589587
590588 debug ! (
591- "Selected sequence {} with most missing sequence ({}bp)" ,
592- seq_name, max_total_missing
589+ "Selected sequence {seq_name} with most missing sequence ({max_total_missing}bp)"
593590 ) ;
594591
595592 ranges_to_window. push ( ( seq_id, 0 , seq_length) ) ;
@@ -1232,7 +1229,7 @@ fn write_partition(
12321229 }
12331230 _ => Err ( io:: Error :: new (
12341231 io:: ErrorKind :: InvalidInput ,
1235- format ! ( "Unsupported output format: {}" , output_format ) ,
1232+ format ! ( "Unsupported output format: {output_format}" ) ,
12361233 ) ) ,
12371234 }
12381235}
@@ -1246,8 +1243,8 @@ fn write_partition_bed(
12461243) -> io:: Result < ( ) > {
12471244 // Create filename with optional suffix
12481245 let filename = match suffix {
1249- Some ( s) => format ! ( "partition{}.bed{}" , partition_num , s ) ,
1250- None => format ! ( "partition{}.bed" , partition_num ) ,
1246+ Some ( s) => format ! ( "partition{partition_num }.bed{s}" ) ,
1247+ None => format ! ( "partition{partition_num }.bed" ) ,
12511248 } ;
12521249
12531250 // Create full path with output folder
@@ -1265,7 +1262,7 @@ fn write_partition_bed(
12651262 ( query_interval. last , query_interval. first )
12661263 } ;
12671264
1268- writeln ! ( writer, "{}\t {}\t {}" , name , start , end ) ?;
1265+ writeln ! ( writer, "{name }\t {start }\t {end}" ) ?;
12691266 }
12701267
12711268 writer. flush ( ) ?;
@@ -1289,13 +1286,13 @@ fn write_partition_gfa(
12891286 ) ;
12901287
12911288 // Create output file
1292- let filename = format ! ( "partition{}.gfa" , partition_num ) ;
1289+ let filename = format ! ( "partition{partition_num }.gfa" ) ;
12931290 let full_path = create_output_path ( output_folder, & filename) ?;
12941291 let file = File :: create ( full_path) ?;
12951292 let mut writer = BufWriter :: new ( file) ;
12961293
12971294 // Write the GFA output to the file
1298- writeln ! ( writer, "{}" , gfa_output ) ?;
1295+ writeln ! ( writer, "{gfa_output}" ) ?;
12991296 writer. flush ( ) ?;
13001297 Ok ( ( ) )
13011298}
@@ -1317,13 +1314,13 @@ fn write_partition_maf(
13171314 ) ;
13181315
13191316 // Create output file
1320- let filename = format ! ( "partition{}.maf" , partition_num ) ;
1317+ let filename = format ! ( "partition{partition_num }.maf" ) ;
13211318 let full_path = create_output_path ( output_folder, & filename) ?;
13221319 let file = File :: create ( full_path) ?;
13231320 let mut writer = BufWriter :: new ( file) ;
13241321
13251322 // Write the MAF output to the file
1326- write ! ( writer, "{}" , maf_output ) ?;
1323+ write ! ( writer, "{maf_output}" ) ?;
13271324 writer. flush ( ) ?;
13281325 Ok ( ( ) )
13291326}
@@ -1338,7 +1335,7 @@ fn write_partition_fasta(
13381335 reverse_complement : bool ,
13391336) -> io:: Result < ( ) > {
13401337 // Create output file
1341- let filename = format ! ( "partition{}.fasta" , partition_num ) ;
1338+ let filename = format ! ( "partition{partition_num }.fasta" ) ;
13421339 let full_path = create_output_path ( output_folder, & filename) ?;
13431340 let file = File :: create ( full_path) ?;
13441341 let mut writer = BufWriter :: new ( file) ;
@@ -1369,7 +1366,7 @@ fn write_partition_fasta(
13691366 } else {
13701367 ""
13711368 } ;
1372- writeln ! ( writer, ">{}:{}-{}{}" , query_name , start , end , header_suffix ) ?;
1369+ writeln ! ( writer, ">{query_name }:{start }-{end}{header_suffix}" ) ?;
13731370
13741371 // Write sequence in lines of 80 characters
13751372 let sequence_str = String :: from_utf8_lossy ( & sequence) ;
@@ -1404,7 +1401,7 @@ fn write_single_partition_file(
14041401 ( query_interval. last , query_interval. first )
14051402 } ;
14061403
1407- writeln ! ( writer, "{} {} {} {}" , name , start , end , partition_num ) ?;
1404+ writeln ! ( writer, "{name } {start } {end } {partition_num}" ) ?;
14081405 }
14091406 }
14101407
@@ -1414,8 +1411,7 @@ fn write_single_partition_file(
14141411 _ => Err ( io:: Error :: new (
14151412 io:: ErrorKind :: InvalidInput ,
14161413 format ! (
1417- "Single-file output not supported for format: {}" ,
1418- output_format
1414+ "Single-file output not supported for format: {output_format}"
14191415 ) ,
14201416 ) ) ,
14211417 }
0 commit comments