diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-11-28 17:28:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 17:28:54 -0500 |
commit | 2d4c46c975eb916dc622cc729a1a8d397582a76f (patch) | |
tree | 445e819117acd2f94ffc9d7da7ed8e3e604435d0 /cli/args/lockfile.rs | |
parent | f526513d74d34ac254aa40ef9b73238cb21c395b (diff) |
refactor: create util folder, move nap_sym to napi/sym, move http_cache to cache folder (#16857)
Diffstat (limited to 'cli/args/lockfile.rs')
-rw-r--r-- | cli/args/lockfile.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/args/lockfile.rs b/cli/args/lockfile.rs index f99d2f570..73a075f81 100644 --- a/cli/args/lockfile.rs +++ b/cli/args/lockfile.rs @@ -20,6 +20,7 @@ use crate::npm::NpmPackageId; use crate::npm::NpmPackageReq; use crate::npm::NpmResolutionPackage; use crate::tools::fmt::format_json; +use crate::util; use crate::Flags; #[derive(Debug)] @@ -260,7 +261,7 @@ impl Lockfile { /// is not included, insert it. fn check_or_insert(&mut self, specifier: &str, code: &str) -> bool { if let Some(lockfile_checksum) = self.content.remote.get(specifier) { - let compiled_checksum = crate::checksum::gen(&[code.as_bytes()]); + let compiled_checksum = util::checksum::gen(&[code.as_bytes()]); lockfile_checksum == &compiled_checksum } else { self.insert(specifier, code); @@ -269,7 +270,7 @@ impl Lockfile { } fn insert(&mut self, specifier: &str, code: &str) { - let checksum = crate::checksum::gen(&[code.as_bytes()]); + let checksum = util::checksum::gen(&[code.as_bytes()]); self.content.remote.insert(specifier.to_string(), checksum); self.has_content_changed = true; } @@ -359,7 +360,7 @@ impl deno_graph::source::Locker for Locker { } fn get_checksum(&self, content: &str) -> String { - crate::checksum::gen(&[content.as_bytes()]) + util::checksum::gen(&[content.as_bytes()]) } fn get_filename(&self) -> Option<String> { |