Run recover_comment_removed() only if the text changed after format

This commit is contained in:
Seiichi Uchida 2017-09-18 22:56:29 +09:00
parent c313fb1ddc
commit 20aecb3d98

View File

@ -826,7 +826,7 @@ pub fn recover_comment_removed(
shape: Shape,
) -> Option<String> {
let snippet = context.snippet(span);
if changed_comment_content(&snippet, &new) {
if snippet != new && changed_comment_content(&snippet, &new) {
// We missed some comments
// Keep previous formatting if it satisfies the constrains
wrap_str(snippet, context.config.max_width(), shape)