File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,16 @@ use std::env;
8
8
9
9
fn docs_link ( diag : & mut DiagnosticBuilder < ' _ > , lint : & ' static Lint ) {
10
10
if env:: var ( "CLIPPY_DISABLE_DOCS_LINKS" ) . is_err ( ) {
11
- diag. help ( & format ! (
12
- "for further information visit https://rust-lang.github.io/rust-clippy/{}/index.html#{}" ,
13
- & option_env!( "RUST_RELEASE_NUM" ) . map_or( "master" . to_string( ) , |n| {
14
- // extract just major + minor version and ignore patch versions
15
- format!( "rust-{}" , n. rsplitn( 2 , '.' ) . nth( 1 ) . unwrap( ) )
16
- } ) ,
17
- lint. name_lower( ) . replacen( "clippy::" , "" , 1 )
18
- ) ) ;
11
+ if let Some ( lint) = lint. name_lower ( ) . strip_prefix ( "clippy::" ) {
12
+ diag. help ( & format ! (
13
+ "for further information visit https://rust-lang.github.io/rust-clippy/{}/index.html#{}" ,
14
+ & option_env!( "RUST_RELEASE_NUM" ) . map_or( "master" . to_string( ) , |n| {
15
+ // extract just major + minor version and ignore patch versions
16
+ format!( "rust-{}" , n. rsplitn( 2 , '.' ) . nth( 1 ) . unwrap( ) )
17
+ } ) ,
18
+ lint
19
+ ) ) ;
20
+ }
19
21
}
20
22
}
21
23
You can’t perform that action at this time.
0 commit comments