From 55a9977c6252a38fac721ad789df0c7e8acf33c9 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 26 Apr 2023 13:07:15 -0400 Subject: refactor(compile): remove usage of ProcState and CliOptions (#18855) --- cli/npm/cache.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cli/npm') diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index eb674d3cb..0d88109de 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -129,7 +129,7 @@ impl Default for ReadonlyNpmCache { // This only gets used when creating the tsc runtime and for testing, and so // it shouldn't ever actually access the DenoDir, so it doesn't support a // custom root. - Self::from_deno_dir(&DenoDir::new(None).unwrap()) + Self::new(DenoDir::new(None).unwrap().npm_folder_path()) } } @@ -155,10 +155,6 @@ impl ReadonlyNpmCache { } } - pub fn from_deno_dir(dir: &DenoDir) -> Self { - Self::new(dir.npm_folder_path()) - } - pub fn root_dir_url(&self) -> &Url { &self.root_dir_url } @@ -306,14 +302,14 @@ pub struct NpmCache { } impl NpmCache { - pub fn from_deno_dir( - dir: &DenoDir, + pub fn new( + cache_dir_path: PathBuf, cache_setting: CacheSetting, http_client: HttpClient, progress_bar: ProgressBar, ) -> Self { Self { - readonly: ReadonlyNpmCache::from_deno_dir(dir), + readonly: ReadonlyNpmCache::new(cache_dir_path), cache_setting, http_client, progress_bar, -- cgit v1.2.3