File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,10 @@ lazy_static! {
30
30
)
31
31
. unwrap( ) ;
32
32
static ref NL_ESCAPE_RE : Regex = Regex :: new( r#"\\\n\s*"# ) . unwrap( ) ;
33
- pub static ref DOCS_LINK : String = "https://rust-lang.github.io/rust-clippy/master/index.html" . to_string( ) ;
34
33
}
35
34
35
+ pub static DOCS_LINK : & str = "https://rust-lang.github.io/rust-clippy/master/index.html" ;
36
+
36
37
/// Lint data parsed from the Clippy source code.
37
38
#[ derive( Clone , PartialEq , Debug ) ]
38
39
pub struct Lint {
@@ -120,7 +121,7 @@ pub fn gen_changelog_lint_list(lints: Vec<Lint>) -> Vec<String> {
120
121
if l. is_internal ( ) {
121
122
None
122
123
} else {
123
- Some ( format ! ( "[`{}`]: {}#{}" , l. name, DOCS_LINK . clone ( ) , l. name) )
124
+ Some ( format ! ( "[`{}`]: {}#{}" , l. name, DOCS_LINK , l. name) )
124
125
}
125
126
} )
126
127
. collect ( )
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ fn print_lints() {
150
150
println ! (
151
151
"* [{}]({}#{}) ({})" ,
152
152
lint. name,
153
- clippy_dev:: DOCS_LINK . clone ( ) ,
153
+ clippy_dev:: DOCS_LINK ,
154
154
lint. name,
155
155
lint. desc
156
156
) ;
@@ -191,16 +191,18 @@ fn update_lints(update_mode: UpdateMode) {
191
191
192
192
file_change |= replace_region_in_file (
193
193
Path :: new ( "README.md" ) ,
194
- r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html \)"# ,
194
+ & format ! ( r#"\[There are \d+ lints included in this crate!\]\({} \)"# , DOCS_LINK ) ,
195
195
"" ,
196
196
true ,
197
197
update_mode == UpdateMode :: Change ,
198
198
|| {
199
- vec ! [
200
- format!( "[There are {} lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)" , lint_count)
201
- ]
202
- }
203
- ) . changed ;
199
+ vec ! [ format!(
200
+ "[There are {} lints included in this crate!]({})" ,
201
+ lint_count, DOCS_LINK
202
+ ) ]
203
+ } ,
204
+ )
205
+ . changed ;
204
206
205
207
file_change |= replace_region_in_file (
206
208
Path :: new ( "CHANGELOG.md" ) ,
You can’t perform that action at this time.
0 commit comments