mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 20:43:03 +00:00
Run recover_comment_removed() only if the text changed after format
This commit is contained in:
parent
c313fb1ddc
commit
20aecb3d98
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user