Skip to content

Commit

Permalink
fix padding and put clippy someplaces
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Jun 12, 2019
1 parent cfd7e0d commit 73259d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions clippy_dev/src/main.rs
Expand Up @@ -103,6 +103,7 @@ fn update_lints(update_mode: &UpdateMode) {
pub mod lint;
pub use lint::Lint;
pub use lint::LINT_LEVELS;
pub use lint::LintLevel;
pub const ALL_LINTS: [Lint; {}] = {:#?};\n",
sorted_usable_lints.len(),
Expand Down
9 changes: 7 additions & 2 deletions src/driver.rs
Expand Up @@ -130,6 +130,11 @@ Available lint options:
.iter()
.find(|level_mapping| level_mapping.0 == lint.group)
.map(|(_, level)| level)
.map(|level| match level {
LintLevel::Allow => "allow",
LintLevel::Warn => "warn",
LintLevel::Deny => "deny",
})
.unwrap()
};

Expand Down Expand Up @@ -184,7 +189,7 @@ Available lint options:
s
};

println!("Lint groups provided by rustc:\n");
println!("Lint groups provided by clippy:\n");
println!(" {} sub-lints", padded("name"));
println!(" {} ---------", padded("----"));

Expand All @@ -198,7 +203,7 @@ Available lint options:
.map(|name| name.replace("_", "-"))
.collect::<Vec<String>>()
.join(", ");
println!(" {} {}", padded(&name), desc);
println!(" {} {}", padded(&scoped(&name)), desc);
}
println!("\n");
};
Expand Down
12 changes: 0 additions & 12 deletions src/lintlist/lint.rs
Expand Up @@ -15,18 +15,6 @@ pub enum LintLevel {
Deny,
}

impl std::fmt::Display for LintLevel {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let s = match self {
LintLevel::Allow => "allow",
LintLevel::Warn => "warn",
LintLevel::Deny => "deny",
};

write!(f, "{}", s)
}
}

pub const LINT_LEVELS: [(&str, LintLevel); 8] = [
("correctness", LintLevel::Deny),
("style", LintLevel::Warn),
Expand Down
1 change: 1 addition & 0 deletions src/lintlist/mod.rs
Expand Up @@ -3,6 +3,7 @@
pub mod lint;
pub use lint::Lint;
pub use lint::LINT_LEVELS;
pub use lint::LintLevel;

pub const ALL_LINTS: [Lint; 304] = [
Lint {
Expand Down

0 comments on commit 73259d6

Please sign in to comment.