@@ -1773,16 +1773,11 @@ impl HumanEmitter {
1773
1773
let suggestions = suggestion. splice_lines ( sm) ;
1774
1774
debug ! ( ?suggestions) ;
1775
1775
1776
- if suggestions
1777
- . iter ( )
1776
+ if suggestions. is_empty ( ) {
1778
1777
// Here we check if there are suggestions that have actual code changes. We sometimes
1779
1778
// suggest the same code that is already there, instead of changing how we produce the
1780
1779
// 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
1786
1781
// approach to avoid ICEs by ignoring the suggestion outright.
1787
1782
return Ok ( ( ) ) ;
1788
1783
}
@@ -1796,7 +1791,6 @@ impl HumanEmitter {
1796
1791
let mut msg = vec ! [ ( suggestion. msg. to_owned( ) , Style :: NoStyle ) ] ;
1797
1792
if suggestions
1798
1793
. iter ( )
1799
- . filter ( |( _, _, highlights, _) | !highlights. is_empty ( ) )
1800
1794
. take ( MAX_SUGGESTIONS )
1801
1795
. any ( |( _, _, _, only_capitalization) | * only_capitalization)
1802
1796
{
@@ -1813,11 +1807,7 @@ impl HumanEmitter {
1813
1807
1814
1808
let mut row_num = 2 ;
1815
1809
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 ) {
1821
1811
debug ! ( ?complete, ?parts, ?highlights) ;
1822
1812
1823
1813
let has_deletion = parts. iter ( ) . any ( |p| p. is_deletion ( sm) ) ;
0 commit comments