@@ -8,7 +8,7 @@ use std::time::Duration;
88use serde:: Deserialize ;
99use walkdir:: { DirEntry , WalkDir } ;
1010
11- use crate :: { Crate , LINTCHECK_DOWNLOADS , LINTCHECK_SOURCES } ;
11+ use crate :: { Crate , lintcheck_downloads , lintcheck_sources , target_dir } ;
1212
1313const DEFAULT_DOCS_LINK : & str = "https://docs.rs/{krate}/{version}/src/{krate_}/{file}.html#{line}" ;
1414const DEFAULT_GITHUB_LINK : & str = "{url}/blob/{hash}/src/{file}#L{line}" ;
@@ -201,8 +201,8 @@ impl CrateWithSource {
201201 let file_link = & self . file_link ;
202202 match & self . source {
203203 CrateSource :: CratesIo { version } => {
204- let extract_dir = PathBuf :: from ( LINTCHECK_SOURCES ) ;
205- let krate_download_dir = PathBuf :: from ( LINTCHECK_DOWNLOADS ) ;
204+ let extract_dir = PathBuf :: from ( lintcheck_sources ( ) ) ;
205+ let krate_download_dir = PathBuf :: from ( lintcheck_downloads ( ) ) ;
206206
207207 // url to download the crate from crates.io
208208 let url = format ! ( "https://crates.io/api/v1/crates/{name}/{version}/download" ) ;
@@ -236,7 +236,7 @@ impl CrateWithSource {
236236 } ,
237237 CrateSource :: Git { url, commit } => {
238238 let repo_path = {
239- let mut repo_path = PathBuf :: from ( LINTCHECK_SOURCES ) ;
239+ let mut repo_path = PathBuf :: from ( lintcheck_sources ( ) ) ;
240240 // add a -git suffix in case we have the same crate from crates.io and a git repo
241241 repo_path. push ( format ! ( "{name}-git" ) ) ;
242242 repo_path
@@ -286,7 +286,7 @@ impl CrateWithSource {
286286 // copy path into the dest_crate_root but skip directories that contain a CACHEDIR.TAG file.
287287 // The target/ directory contains a CACHEDIR.TAG file so it is the most commonly skipped directory
288288 // as a result of this filter.
289- let dest_crate_root = PathBuf :: from ( LINTCHECK_SOURCES ) . join ( name) ;
289+ let dest_crate_root = PathBuf :: from ( lintcheck_sources ( ) ) . join ( name) ;
290290 if dest_crate_root. exists ( ) {
291291 println ! ( "Deleting existing directory at `{}`" , dest_crate_root. display( ) ) ;
292292 fs:: remove_dir_all ( & dest_crate_root) . unwrap ( ) ;
@@ -326,7 +326,7 @@ impl CrateWithSource {
326326///
327327/// This function panics if creating one of the dirs fails.
328328fn create_dirs ( krate_download_dir : & Path , extract_dir : & Path ) {
329- fs:: create_dir ( "target /lintcheck/") . unwrap_or_else ( |err| {
329+ fs:: create_dir ( format ! ( "{} /lintcheck/", target_dir ( ) ) ) . unwrap_or_else ( |err| {
330330 assert_eq ! (
331331 err. kind( ) ,
332332 ErrorKind :: AlreadyExists ,
0 commit comments