Skip to content

Commit 12dc030

Browse files
committed
lintcheck: fix bug when getting the config toml path.
In order to check if we need to recheck crates, I was getting the path from clap only which is None if we don't pass it via cmdline args. Use the dedicated lintcheck_config_toml() fnuction instead!
1 parent d5223be commit 12dc030

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_dev/src/lintcheck.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ fn build_clippy() {
336336
}
337337

338338
/// Read a `toml` file and return a list of `CrateSources` that we want to check with clippy
339-
fn read_crates(toml_path: Option<&str>) -> (String, Vec<CrateSource>) {
340-
let toml_path = lintcheck_config_toml(toml_path);
339+
fn read_crates(clap_toml_path: Option<&str>) -> (String, Vec<CrateSource>) {
340+
let toml_path = lintcheck_config_toml(clap_toml_path);
341341
// save it so that we can use the name of the sources.toml as name for the logfile later.
342342
let toml_filename = toml_path.file_stem().unwrap().to_str().unwrap().to_string();
343343
let toml_content: String =
@@ -478,7 +478,8 @@ pub fn run(clap_config: &ArgMatches) {
478478
build_clippy();
479479
println!("Done compiling");
480480

481-
let clap_toml_path = clap_config.value_of("crates-toml");
481+
let clap_toml_path: Option<&str> = clap_config.value_of("crates-toml");
482+
let toml_path = lintcheck_config_toml(clap_toml_path);
482483

483484
// if the clippy bin is newer than our logs, throw away target dirs to force clippy to
484485
// refresh the logs

0 commit comments

Comments
 (0)