@@ -1748,16 +1748,11 @@ impl HumanEmitter {
17481748 let suggestions = suggestion. splice_lines ( sm) ;
17491749 debug ! ( ?suggestions) ;
17501750
1751- if suggestions
1752- . iter ( )
1751+ if suggestions. is_empty ( ) {
17531752 // Here we check if there are suggestions that have actual code changes. We sometimes
17541753 // suggest the same code that is already there, instead of changing how we produce the
17551754 // suggestions and filtering there, we just don't emit the suggestion.
1756- . filter ( |( _, _, highlights, _) | !highlights. iter ( ) . all ( |parts| parts. is_empty ( ) ) )
1757- . count ( )
1758- == 0
1759- {
1760- // Suggestions coming from macros can have malformed spans. This is a heavy handed
1755+ // Suggestions coming from macros can also have malformed spans. This is a heavy handed
17611756 // approach to avoid ICEs by ignoring the suggestion outright.
17621757 return Ok ( ( ) ) ;
17631758 }
@@ -1771,7 +1766,6 @@ impl HumanEmitter {
17711766 let mut msg = vec ! [ ( suggestion. msg. to_owned( ) , Style :: NoStyle ) ] ;
17721767 if suggestions
17731768 . iter ( )
1774- . filter ( |( _, _, highlights, _) | !highlights. is_empty ( ) )
17751769 . take ( MAX_SUGGESTIONS )
17761770 . any ( |( _, _, _, only_capitalization) | * only_capitalization)
17771771 {
@@ -1788,11 +1782,7 @@ impl HumanEmitter {
17881782
17891783 let mut row_num = 2 ;
17901784 draw_col_separator_no_space ( & mut buffer, 1 , max_line_num_len + 1 ) ;
1791- for ( complete, parts, highlights, _) in suggestions
1792- . iter ( )
1793- . filter ( |( _, _, highlights, _) | !highlights. is_empty ( ) )
1794- . take ( MAX_SUGGESTIONS )
1795- {
1785+ for ( complete, parts, highlights, _) in suggestions. iter ( ) . take ( MAX_SUGGESTIONS ) {
17961786 debug ! ( ?complete, ?parts, ?highlights) ;
17971787
17981788 let has_deletion = parts. iter ( ) . any ( |p| p. is_deletion ( sm) ) ;
0 commit comments