diff options
| author | Philipp Krones <hello@philkrones.com> | 2023-07-02 14:35:19 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2023-07-02 14:59:02 +0200 |
| commit | cb3ecf7b792fdc4b00e61935b9e40ca836752492 (patch) | |
| tree | a183611f56d9139413f6ab1c78c0619512d3c751 /src | |
| parent | bb33e0343fe37815f6180a861619a9fca6771ce9 (diff) | |
| download | rust-cb3ecf7b792fdc4b00e61935b9e40ca836752492.tar.gz rust-cb3ecf7b792fdc4b00e61935b9e40ca836752492.zip | |
Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyup
Diffstat (limited to 'src')
| -rw-r--r-- | src/driver.rs | 2 | ||||
| -rw-r--r-- | src/main.rs | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/driver.rs b/src/driver.rs index f3cc94aeff0..1eb288b153a 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -16,9 +16,9 @@ extern crate rustc_session; extern crate rustc_span; use rustc_interface::interface; -use rustc_session::EarlyErrorHandler; use rustc_session::config::ErrorOutputType; use rustc_session::parse::ParseSess; +use rustc_session::EarlyErrorHandler; use rustc_span::symbol::Symbol; use std::env; diff --git a/src/main.rs b/src/main.rs index 188ff87abfc..cdc85cb33ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use std::env; use std::path::PathBuf; use std::process::{self, Command}; -const CARGO_CLIPPY_HELP: &str = r#"Checks a package to catch common mistakes and improve your Rust code. +const CARGO_CLIPPY_HELP: &str = "Checks a package to catch common mistakes and improve your Rust code. Usage: cargo clippy [options] [--] [<opts>...] @@ -31,7 +31,7 @@ with: You can use tool lints to allow or deny lints from your code, e.g.: #[allow(clippy::needless_lifetimes)] -"#; +"; fn show_help() { println!("{CARGO_CLIPPY_HELP}"); @@ -57,7 +57,9 @@ pub fn main() { if let Some(pos) = env::args().position(|a| a == "--explain") { if let Some(mut lint) = env::args().nth(pos + 1) { lint.make_ascii_lowercase(); - clippy_lints::explain(&lint.strip_prefix("clippy::").unwrap_or(&lint).replace('-', "_")); + process::exit(clippy_lints::explain( + &lint.strip_prefix("clippy::").unwrap_or(&lint).replace('-', "_"), + )); } else { show_help(); } |
