[rustdoc] Suggest trailing \
instead of two spaces for hard line break
#12163
Labels
A-lint
Area: New lints
\
instead of two spaces for hard line break
#12163
What it does
When a rustdoc comment contains two trailing spaces for a Markdown hard line break, the lint should suggest using a trailing backslash (
\
) instead.rustdoc uses CommonMark, and it allows using
\
for hard line breaks, see the specification.Advantage
A trailing
\
makes the intention for a hard line break clearer than two trailing spaces, which can be difficult to notice in Git diffs, and might be removed accidentally during refactoring.Drawbacks
\
is subjective(this could be solved by adding the lint to
clippy::pedantic
)> ...
follows), then the\
might be shown literally (CommonMark example)Example
(
·
indicating a space)Could be written as:
The text was updated successfully, but these errors were encountered: