move Lint static def into its own module

This commit is contained in:
Jane Lusby 2019-06-08 11:47:24 -07:00
parent f6367c41dc
commit 5abcff2be5
3 changed files with 14 additions and 19 deletions

View file

@ -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(),

9
src/lintlist/lint.rs Normal file
View file

@ -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,
}

View file

@ -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 {