Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2d07c33

Browse files
author
hyd-dev
committed
Rename ClippyArgsCallbacks to RustcCallbacks
1 parent 03e72d5 commit 2d07c33

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/driver.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ fn track_clippy_args(sess: &Session, args_env_var: &Option<String>) {
7373
struct DefaultCallbacks;
7474
impl rustc_driver::Callbacks for DefaultCallbacks {}
7575

76-
struct ClippyArgsCallbacks {
76+
/// This is different from `DefaultCallbacks` that it will inform Cargo to track the value of
77+
/// `CLIPPY_ARGS` environment variable.
78+
struct RustcCallbacks {
7779
clippy_args_var: Option<String>,
7880
}
7981

80-
impl rustc_driver::Callbacks for ClippyArgsCallbacks {
82+
impl rustc_driver::Callbacks for RustcCallbacks {
8183
fn config(&mut self, config: &mut interface::Config) {
8284
let previous = config.register_lints.take();
8385
let clippy_args_var = self.clippy_args_var.take();
@@ -351,7 +353,7 @@ pub fn main() {
351353
if clippy_enabled {
352354
rustc_driver::RunCompiler::new(&args, &mut ClippyCallbacks { clippy_args_var }).run()
353355
} else {
354-
rustc_driver::RunCompiler::new(&args, &mut ClippyArgsCallbacks { clippy_args_var }).run()
356+
rustc_driver::RunCompiler::new(&args, &mut RustcCallbacks { clippy_args_var }).run()
355357
}
356358
}))
357359
}

0 commit comments

Comments
 (0)