diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 4c50cc3b81e..e33b052cf28 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -95,20 +95,13 @@ fn update_lints(update_mode: &UpdateMode) { sorted_usable_lints.sort_by_key(|lint| lint.name.clone()); std::fs::write( - "../src/lintlist.rs", + "../src/lintlist/mod.rs", &format!( "\ //! This file is managed by util/dev update_lints. Do not edit. -/// Lint data parsed from the Clippy source code. -#[derive(Clone, PartialEq, Debug)] -pub struct Lint {{ - pub name: &'static str, - pub group: &'static str, - pub desc: &'static str, - pub deprecation: Option<&'static str>, - pub module: &'static str, -}} +mod lint; +use lint::Lint; pub const ALL_LINTS: [Lint; {}] = {:#?};\n", sorted_usable_lints.len(), diff --git a/src/lintlist/lint.rs b/src/lintlist/lint.rs new file mode 100644 index 00000000000..a4dd0747059 --- /dev/null +++ b/src/lintlist/lint.rs @@ -0,0 +1,9 @@ +/// Lint data parsed from the Clippy source code. +#[derive(Clone, PartialEq, Debug)] +pub struct Lint { + pub name: &'static str, + pub group: &'static str, + pub desc: &'static str, + pub deprecation: Option<&'static str>, + pub module: &'static str, +} diff --git a/src/lintlist.rs b/src/lintlist/mod.rs similarity index 99% rename from src/lintlist.rs rename to src/lintlist/mod.rs index 113f993dd8a..cf367bcc632 100644 --- a/src/lintlist.rs +++ b/src/lintlist/mod.rs @@ -1,14 +1,7 @@ //! This file is managed by util/dev update_lints. Do not edit. -/// Lint data parsed from the Clippy source code. -#[derive(Clone, PartialEq, Debug)] -pub struct Lint { - pub name: &'static str, - pub group: &'static str, - pub desc: &'static str, - pub deprecation: Option<&'static str>, - pub module: &'static str, -} +mod lint; +use lint::Lint; pub const ALL_LINTS: [Lint; 304] = [ Lint {