diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-04-14 16:22:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 16:22:33 -0400 |
commit | 136dce67cec749dce5989ea29e88359ef79a0045 (patch) | |
tree | 38e96bbbf22dc06cdba418a35467b215f1335549 /cli/npm/cache.rs | |
parent | a4111442191fff300132259752e6d2d5613d1871 (diff) |
refactor: break up `ProcState` (#18707)
1. Breaks up functionality within `ProcState` into several other structs
to break out the responsibilities (`ProcState` is only a data struct
now).
2. Moves towards being able to inject dependencies more easily and have
functionality only require what it needs.
3. Exposes `Arc<T>` around the "service structs" instead of it being
embedded within them. The idea behind embedding them was to reduce the
verbosity of needing to pass around `Arc<...>`, but I don't think it was
exactly working and as we move more of these structs to be more
injectable I don't think the extra verbosity will be a big deal.
Diffstat (limited to 'cli/npm/cache.rs')
-rw-r--r-- | cli/npm/cache.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index 1ad6bf72a..eb674d3cb 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -4,7 +4,6 @@ use std::collections::HashSet; use std::fs; use std::path::Path; use std::path::PathBuf; -use std::sync::Arc; use deno_ast::ModuleSpecifier; use deno_core::anyhow::bail; @@ -296,14 +295,14 @@ impl ReadonlyNpmCache { } /// Stores a single copy of npm packages in a cache. -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct NpmCache { readonly: ReadonlyNpmCache, cache_setting: CacheSetting, http_client: HttpClient, progress_bar: ProgressBar, /// ensures a package is only downloaded once per run - previously_reloaded_packages: Arc<Mutex<HashSet<NpmPackageNv>>>, + previously_reloaded_packages: Mutex<HashSet<NpmPackageNv>>, } impl NpmCache { |