Skip to content

Commit 0a334b2

Browse files
committed
fix padding and put clippy someplaces
1 parent c81cf91 commit 0a334b2

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

clippy_dev/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ fn update_lints(update_mode: &UpdateMode) {
103103
pub mod lint;
104104
pub use lint::Lint;
105105
pub use lint::LINT_LEVELS;
106+
pub use lint::LintLevel;
106107
107108
pub const ALL_LINTS: [Lint; {}] = {:#?};\n",
108109
sorted_usable_lints.len(),

src/driver.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ Available lint options:
130130
.iter()
131131
.find(|level_mapping| level_mapping.0 == lint.group)
132132
.map(|(_, level)| level)
133+
.map(|level| match level {
134+
LintLevel::Allow => "allow",
135+
LintLevel::Warn => "warn",
136+
LintLevel::Deny => "deny",
137+
})
133138
.unwrap()
134139
};
135140

@@ -184,7 +189,7 @@ Available lint options:
184189
s
185190
};
186191

187-
println!("Lint groups provided by rustc:\n");
192+
println!("Lint groups provided by clippy:\n");
188193
println!(" {} sub-lints", padded("name"));
189194
println!(" {} ---------", padded("----"));
190195

@@ -198,7 +203,7 @@ Available lint options:
198203
.map(|name| name.replace("_", "-"))
199204
.collect::<Vec<String>>()
200205
.join(", ");
201-
println!(" {} {}", padded(&name), desc);
206+
println!(" {} {}", padded(&scoped(&name)), desc);
202207
}
203208
println!("\n");
204209
};

src/lintlist/lint.rs

-12
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ pub enum LintLevel {
1515
Deny,
1616
}
1717

18-
impl std::fmt::Display for LintLevel {
19-
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
20-
let s = match self {
21-
LintLevel::Allow => "allow",
22-
LintLevel::Warn => "warn",
23-
LintLevel::Deny => "deny",
24-
};
25-
26-
write!(f, "{}", s)
27-
}
28-
}
29-
3018
pub const LINT_LEVELS: [(&str, LintLevel); 8] = [
3119
("correctness", LintLevel::Deny),
3220
("style", LintLevel::Warn),

src/lintlist/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
pub mod lint;
44
pub use lint::Lint;
55
pub use lint::LINT_LEVELS;
6+
pub use lint::LintLevel;
67

78
pub const ALL_LINTS: [Lint; 304] = [
89
Lint {

0 commit comments

Comments
 (0)