Merge pull request #3457 from rust-lang/clippy_rustup_documentation
Enable rustup clippy to refer to the correct documentation
This commit is contained in:
commit
4dd8c067a9
@ -507,8 +507,11 @@ impl<'a> DiagnosticWrapper<'a> {
|
|||||||
fn docs_link(&mut self, lint: &'static Lint) {
|
fn docs_link(&mut self, lint: &'static Lint) {
|
||||||
if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
|
if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() {
|
||||||
self.0.help(&format!(
|
self.0.help(&format!(
|
||||||
"for further information visit https://rust-lang-nursery.github.io/rust-clippy/v{}/index.html#{}",
|
"for further information visit https://rust-lang-nursery.github.io/rust-clippy/{}/index.html#{}",
|
||||||
env!("CARGO_PKG_VERSION"),
|
&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)
|
lint.name_lower().replacen("clippy::", "", 1)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user