-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
A-lintArea: New lintsArea: New lints
Description
What it does
In a documentation example, when processed by rustdoc
, it is strictly equivalent to write rust
or not (https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html).
Thus it would be nice to have a lint that suggest the removal of the unneeded rust
as language for the example.
Some projects may prefer the opposite, i.e. always writing rust
, thus the equivalent lint for that may be a good idea as well. Either way, consistency is typically an improvement.
Advantage
- Less busy, and more consistent, source code.
- When contributing to a project, there is no need to remember if it is supposed to be written or not.
Drawbacks
- It may be slightly harder to copy the code into a non-
rustdoc
system.
Example
/// ```rust
/// let x = 5;
/// ```
Could be written as:
/// ```
/// let x = 5;
/// ```
joseluis and stanislav-tkachPatchMixolydic and notriddle
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lints