add a pair of whitespace after remove parentheses

This commit is contained in:
bravomikekilo 2019-07-31 22:56:12 +08:00
parent 4eeaaa722d
commit b12c20ccc3
2 changed files with 11 additions and 3 deletions

View file

@ -424,11 +424,19 @@ impl UnusedParens {
},
_ => false,
}
}).to_owned();
});
let replace = {
let mut replace = String::from(" ");
replace.push_str(parens_removed);
replace.push(' ');
replace
};
err.span_suggestion_short(
span,
"remove these parentheses",
parens_removed,
replace,
Applicability::MachineApplicable,
);
err.emit();

View file

@ -81,7 +81,7 @@
}
],
"label": null,
"suggested_replacement": "1 / (2 + 3)",
"suggested_replacement": " 1 / (2 + 3) ",
"suggestion_applicability": "MachineApplicable",
"expansion": null
}