Skip to content

Commit cd962e6

Browse files
Don't render inline suggestions of only spaces
1 parent c2cff68 commit cd962e6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_errors/src/emitter.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,7 @@ pub trait Emitter: Translate {
268268
SuggestionStyle::ShowAlways,
269269
].contains(&sugg.style)
270270
{
271-
// Don't trim the substitution if it's only whitespace changes
272-
let substitution = &sugg.substitutions[0].parts[0].snippet;
273-
let substitution =
274-
if substitution.trim().is_empty() { substitution } else { substitution.trim() };
271+
let substitution = &sugg.substitutions[0].parts[0].snippet.trim();
275272
let msg = if substitution.is_empty() || sugg.style.hide_inline() {
276273
// This substitution is only removal OR we explicitly don't want to show the
277274
// code inline (`hide_inline`). Therefore, we don't show the substitution.

0 commit comments

Comments
 (0)