@@ -1748,16 +1748,11 @@ impl HumanEmitter {
1748
1748
let suggestions = suggestion. splice_lines ( sm) ;
1749
1749
debug ! ( ?suggestions) ;
1750
1750
1751
- if suggestions
1752
- . iter ( )
1751
+ if suggestions. is_empty ( ) {
1753
1752
// Here we check if there are suggestions that have actual code changes. We sometimes
1754
1753
// suggest the same code that is already there, instead of changing how we produce the
1755
1754
// 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
1761
1756
// approach to avoid ICEs by ignoring the suggestion outright.
1762
1757
return Ok ( ( ) ) ;
1763
1758
}
@@ -1771,7 +1766,6 @@ impl HumanEmitter {
1771
1766
let mut msg = vec ! [ ( suggestion. msg. to_owned( ) , Style :: NoStyle ) ] ;
1772
1767
if suggestions
1773
1768
. iter ( )
1774
- . filter ( |( _, _, highlights, _) | !highlights. is_empty ( ) )
1775
1769
. take ( MAX_SUGGESTIONS )
1776
1770
. any ( |( _, _, _, only_capitalization) | * only_capitalization)
1777
1771
{
@@ -1788,11 +1782,7 @@ impl HumanEmitter {
1788
1782
1789
1783
let mut row_num = 2 ;
1790
1784
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 ) {
1796
1786
debug ! ( ?complete, ?parts, ?highlights) ;
1797
1787
1798
1788
let has_deletion = parts. iter ( ) . any ( |p| p. is_deletion ( sm) ) ;
0 commit comments