@@ -1773,16 +1773,11 @@ impl HumanEmitter {
17731773 let suggestions = suggestion. splice_lines ( sm) ;
17741774 debug ! ( ?suggestions) ;
17751775
1776- if suggestions
1777- . iter ( )
1776+ if suggestions. is_empty ( ) {
17781777 // Here we check if there are suggestions that have actual code changes. We sometimes
17791778 // suggest the same code that is already there, instead of changing how we produce the
17801779 // suggestions and filtering there, we just don't emit the suggestion.
1781- . filter ( |( _, _, highlights, _) | !highlights. iter ( ) . all ( |parts| parts. is_empty ( ) ) )
1782- . count ( )
1783- == 0
1784- {
1785- // Suggestions coming from macros can have malformed spans. This is a heavy handed
1780+ // Suggestions coming from macros can also have malformed spans. This is a heavy handed
17861781 // approach to avoid ICEs by ignoring the suggestion outright.
17871782 return Ok ( ( ) ) ;
17881783 }
@@ -1796,7 +1791,6 @@ impl HumanEmitter {
17961791 let mut msg = vec ! [ ( suggestion. msg. to_owned( ) , Style :: NoStyle ) ] ;
17971792 if suggestions
17981793 . iter ( )
1799- . filter ( |( _, _, highlights, _) | !highlights. is_empty ( ) )
18001794 . take ( MAX_SUGGESTIONS )
18011795 . any ( |( _, _, _, only_capitalization) | * only_capitalization)
18021796 {
@@ -1813,11 +1807,7 @@ impl HumanEmitter {
18131807
18141808 let mut row_num = 2 ;
18151809 draw_col_separator_no_space ( & mut buffer, 1 , max_line_num_len + 1 ) ;
1816- for ( complete, parts, highlights, _) in suggestions
1817- . iter ( )
1818- . filter ( |( _, _, highlights, _) | !highlights. is_empty ( ) )
1819- . take ( MAX_SUGGESTIONS )
1820- {
1810+ for ( complete, parts, highlights, _) in suggestions. iter ( ) . take ( MAX_SUGGESTIONS ) {
18211811 debug ! ( ?complete, ?parts, ?highlights) ;
18221812
18231813 let has_deletion = parts. iter ( ) . any ( |p| p. is_deletion ( sm) ) ;
0 commit comments