-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for handling empty code block in doc comment #5601
Fix for handling empty code block in doc comment #5601
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for opening up this new PR!
Related open PR: #5235 |
@tgross35 thanks, I was aware of the other PR and was planning on closing it. Will do so now |
While I think there's little rationale and utility in practice for having a doc comment codeblock with nothing but whitespace, and obviously a panic is unacceptable, but do we feel that trimming that whitespace is the correct/desirable behavior? |
Imho I generally expect rustfmt to eliminate unneeded whitespace, so I would say yes. This would be consistent with what happens when it gets a file with no content and only blank lines - it removes them. |
Yeah that's a fair way of looking at it 👍 |
Fixes #5234
Suggested fix is by trimming the code block, as discussed in (now obsolete) PR #4902.