rustfmt
rustfmt copied to clipboard
Ensure code fences are placed on their own line in doc comments
trafficstars
Fixes #5244
When wrap_comments=true was set there was a chance that the line right before the comment would be wrapped. When this happened, rustfmt didn't place a newline between the wrapped line and the code fence. This placed the start of the code fence on the same line as the previously wrapped line.
Now, rustfmt adds a newline when necessary to ensure that code fences are placed on their own lines.