File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -400,21 +400,21 @@ fn rustfix_and_fix(
400
400
for suggestion in suggestions {
401
401
trace ! ( "suggestion" ) ;
402
402
// Make sure we've got a file associated with this suggestion and all
403
- // snippets point to the same location . Right now it's not clear what
404
- // we would do with multiple locations .
405
- let ( file_name, range ) = match suggestion. snippets . get ( 0 ) {
406
- Some ( s) => ( s . file_name . clone ( ) , s . line_range ) ,
403
+ // snippets point to the same file . Right now it's not clear what
404
+ // we would do with multiple files .
405
+ let file_name = match suggestion. solutions . get ( 0 ) . and_then ( |sol| sol . replacements . get ( 0 ) ) {
406
+ Some ( s) => s . snippet . file_name . clone ( ) ,
407
407
None => {
408
- trace ! ( "rejecting as it has no snippets {:?}" , suggestion) ;
408
+ trace ! ( "rejecting as it has no solutions {:?}" , suggestion) ;
409
409
continue ;
410
410
}
411
411
} ;
412
412
if !suggestion
413
- . snippets
413
+ . solutions
414
414
. iter ( )
415
- . all ( |s| s . file_name == file_name && s . line_range == range )
415
+ . all ( |sol| sol . replacements . iter ( ) . all ( |rep| rep . snippet . file_name == file_name ) )
416
416
{
417
- trace ! ( "rejecting as it spans multiple files {:?}" , suggestion) ;
417
+ trace ! ( "rejecting as it changes multiple files: {:?}" , suggestion) ;
418
418
continue ;
419
419
}
420
420
You can’t perform that action at this time.
0 commit comments