File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1158,10 +1158,10 @@ fn main_result() -> anyhow::Result<i32> {
11581158 scenarios,
11591159 & mut errors,
11601160 ) ;
1161- if diffs . len ( ) == 1 {
1161+ if let [ diff ] = & diffs [ .. ] {
11621162 let short = out_dir. join ( "cgann-diff-latest" ) ;
1163- std:: fs:: copy ( & diffs [ 0 ] , & short) . expect ( "copy to short path" ) ;
1164- eprintln ! ( "Original diff at: {}" , diffs [ 0 ] . to_string_lossy( ) ) ;
1163+ std:: fs:: copy ( diff , & short) . expect ( "copy to short path" ) ;
1164+ eprintln ! ( "Original diff at: {}" , diff . to_string_lossy( ) ) ;
11651165 eprintln ! ( "Short path: {}" , short. to_string_lossy( ) ) ;
11661166 } else {
11671167 eprintln ! ( "Diffs:" ) ;
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ pub async fn compare_artifacts(
8080 None => select_artifact_id ( "base" , & aids) ?. to_string ( ) ,
8181 } ;
8282 aids. retain ( |id| id != & base) ;
83- let modified = if aids . len ( ) == 1 {
84- let new_modified = aids [ 0 ] . clone ( ) ;
83+ let modified = if let [ new_modified ] = & aids [ .. ] {
84+ let new_modified = new_modified . clone ( ) ;
8585 println ! (
8686 "Only 1 artifact remains, automatically selecting: {}" ,
8787 new_modified
You can’t perform that action at this time.
0 commit comments