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> {
1158
1158
scenarios,
1159
1159
& mut errors,
1160
1160
) ;
1161
- if diffs . len ( ) == 1 {
1161
+ if let [ diff ] = & diffs [ .. ] {
1162
1162
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( ) ) ;
1165
1165
eprintln ! ( "Short path: {}" , short. to_string_lossy( ) ) ;
1166
1166
} else {
1167
1167
eprintln ! ( "Diffs:" ) ;
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ pub async fn compare_artifacts(
80
80
None => select_artifact_id ( "base" , & aids) ?. to_string ( ) ,
81
81
} ;
82
82
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 ( ) ;
85
85
println ! (
86
86
"Only 1 artifact remains, automatically selecting: {}" ,
87
87
new_modified
You can’t perform that action at this time.
0 commit comments