From bf237c6241f53122e37341a0dda65ef9e3b51a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 23 Jan 2023 23:41:02 +0100 Subject: refactor: Move lockfile to a separate crate (#17503) Moves the lockfile implementation to a separate crate so other projects like Deploy can use it as well. --- cli/npm/resolution/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cli/npm/resolution') diff --git a/cli/npm/resolution/mod.rs b/cli/npm/resolution/mod.rs index c4d05598c..f10678cbe 100644 --- a/cli/npm/resolution/mod.rs +++ b/cli/npm/resolution/mod.rs @@ -397,10 +397,13 @@ impl NpmResolution { pub fn lock(&self, lockfile: &mut Lockfile) -> Result<(), AnyError> { let snapshot = self.snapshot.read(); for (package_req, package_id) in snapshot.package_reqs.iter() { - lockfile.insert_npm_specifier(package_req, package_id); + lockfile.insert_npm_specifier( + package_req.to_string(), + package_id.as_serialized(), + ); } for package in snapshot.all_packages() { - lockfile.check_or_insert_npm_package(&package)?; + lockfile.check_or_insert_npm_package(package.into())?; } Ok(()) } -- cgit v1.2.3