Skip to content

Commit

Permalink
Merge pull request #3442 from rust-lang/version_ids
Browse files Browse the repository at this point in the history
Enable rustup clippy to refer to the correct documentation
  • Loading branch information
oli-obk committed Nov 22, 2018
2 parents 42da194 + 87ec058 commit 2f6881c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,11 @@ impl<'a> DiagnosticWrapper<'a> {
fn docs_link(&mut self, lint: &'static Lint) {
if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
self.0.help(&format!(
"for further information visit https://rust-lang.github.io/rust-clippy/v{}/index.html#{}",
env!("CARGO_PKG_VERSION"),
"for further information visit https://rust-lang.github.io/rust-clippy/{}/index.html#{}",
&option_env!("RUST_RELEASE_NUM").map_or("master".to_string(), |n| {
// extract just major + minor version and ignore patch versions
format!("rust-{}", n.rsplitn(2, '.').nth(1).unwrap())
}),
lint.name_lower().replacen("clippy::", "", 1)
));
}
Expand Down

0 comments on commit 2f6881c

Please sign in to comment.