From 4e0f4b19dd2cac79117241670c943b68b0027457 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Aug 2023 03:50:14 +1000 Subject: [PATCH] Fix typo in hashing parsed `Cargo.lock` (#159) This simple mistake caused the entire `Cargo.lock` to be ignored (JS treats having no return as `false`). Signed-off-by: Jiahao XU --- dist/restore/index.js | 4 +--- dist/save/index.js | 4 +--- src/config.ts | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index 51219fe..64298cf 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -67048,9 +67048,7 @@ class CacheConfig { } // Package without `[[package]].source` and `[[package]].checksum` // are the one with `path = "..."` to crates within the workspace. - const packages = parsed.package.filter((p) => { - "source" in p || "checksum" in p; - }); + const packages = parsed.package.filter((p) => "source" in p || "checksum" in p); hasher.update(JSON.stringify(packages)); parsedKeyFiles.push(cargo_lock); } diff --git a/dist/save/index.js b/dist/save/index.js index a11263d..a6d9c5d 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -67048,9 +67048,7 @@ class CacheConfig { } // Package without `[[package]].source` and `[[package]].checksum` // are the one with `path = "..."` to crates within the workspace. - const packages = parsed.package.filter((p) => { - "source" in p || "checksum" in p; - }); + const packages = parsed.package.filter((p) => "source" in p || "checksum" in p); hasher.update(JSON.stringify(packages)); parsedKeyFiles.push(cargo_lock); } diff --git a/src/config.ts b/src/config.ts index 07b2eaf..598ab0b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -198,9 +198,7 @@ export class CacheConfig { // Package without `[[package]].source` and `[[package]].checksum` // are the one with `path = "..."` to crates within the workspace. - const packages = parsed.package.filter((p: any) => { - "source" in p || "checksum" in p; - }); + const packages = parsed.package.filter((p: any) => "source" in p || "checksum" in p); hasher.update(JSON.stringify(packages));