You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;/// ```
The text was updated successfully, but these errors were encountered:
Yeah, that may be right, I wasn't sure where to place it (there are other doc-related lints in Clippy already and perhaps rustdoc treats "stylistic diagnostics" like rustc, i.e. leaves those up to Clippy and other tools).
I think it's actually a better idea to put it into clippy as a style lint because it's completely ok to add rust marker on a codeblock, even if useless in most cases.
Uh oh!
There was an error while loading. Please reload this page.
What it does
In a documentation example, when processed by
rustdoc
, it is strictly equivalent to writerust
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
Drawbacks
rustdoc
system.Example
Could be written as:
The text was updated successfully, but these errors were encountered: