rustfmt
rustfmt copied to clipboard
Fix for handling empty code block in doc comments
Suggested fix for issue #4793 for handling empty code block in doc comments (replacing PR #4895). If the doc comments code block includes only empty lines than the output is one line with empty code (///
). If no code line was included between the two ///'''
then the output also does not include any code line.
A simpler solution could be to add trim()
here, i.e to make it _ if self.code_block_buffer.trim().is_empty() =>...
. however it seem that changing format_code_block()
is more robust.