Skip to content

Commit 153a988

Browse files
committed
move Lint static def into its own module
1 parent 8bdefbd commit 153a988

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

clippy_dev/src/main.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,13 @@ fn update_lints(update_mode: &UpdateMode) {
9595
sorted_usable_lints.sort_by_key(|lint| lint.name.clone());
9696

9797
std::fs::write(
98-
"../src/lintlist.rs",
98+
"../src/lintlist/mod.rs",
9999
&format!(
100100
"\
101101
//! This file is managed by util/dev update_lints. Do not edit.
102102
103-
/// Lint data parsed from the Clippy source code.
104-
#[derive(Clone, PartialEq, Debug)]
105-
pub struct Lint {{
106-
pub name: &'static str,
107-
pub group: &'static str,
108-
pub desc: &'static str,
109-
pub deprecation: Option<&'static str>,
110-
pub module: &'static str,
111-
}}
103+
mod lint;
104+
use lint::Lint;
112105
113106
pub const ALL_LINTS: [Lint; {}] = {:#?};\n",
114107
sorted_usable_lints.len(),

src/lintlist/lint.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// Lint data parsed from the Clippy source code.
2+
#[derive(Clone, PartialEq, Debug)]
3+
pub struct Lint {
4+
pub name: &'static str,
5+
pub group: &'static str,
6+
pub desc: &'static str,
7+
pub deprecation: Option<&'static str>,
8+
pub module: &'static str,
9+
}

src/lintlist.rs renamed to src/lintlist/mod.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
//! This file is managed by util/dev update_lints. Do not edit.
22
3-
/// Lint data parsed from the Clippy source code.
4-
#[derive(Clone, PartialEq, Debug)]
5-
pub struct Lint {
6-
pub name: &'static str,
7-
pub group: &'static str,
8-
pub desc: &'static str,
9-
pub deprecation: Option<&'static str>,
10-
pub module: &'static str,
11-
}
3+
mod lint;
4+
use lint::Lint;
125

136
pub const ALL_LINTS: [Lint; 304] = [
147
Lint {

0 commit comments

Comments
 (0)