rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Fix for handling empty code block in doc comments

Open davidBar-On opened this issue 3 years ago • 0 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.

davidBar-On avatar Jul 15 '21 16:07 davidBar-On