We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 246a77e + 2e26fdc commit 4dd8c06Copy full SHA for 4dd8c06
clippy_lints/src/utils/mod.rs
@@ -507,8 +507,11 @@ impl<'a> DiagnosticWrapper<'a> {
507
fn docs_link(&mut self, lint: &'static Lint) {
508
if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
509
self.0.help(&format!(
510
- "for further information visit https://rust-lang-nursery.github.io/rust-clippy/v{}/index.html#{}",
511
- env!("CARGO_PKG_VERSION"),
+ "for further information visit https://rust-lang-nursery.github.io/rust-clippy/{}/index.html#{}",
+ &option_env!("RUST_RELEASE_NUM").map_or("master".to_string(), |n| {
512
+ // extract just major + minor version and ignore patch versions
513
+ format!("rust-{}", n.rsplitn(2, '.').nth(1).unwrap())
514
+ }),
515
lint.name_lower().replacen("clippy::", "", 1)
516
));
517
}
0 commit comments