Skip to content

Commit

Permalink
Fix typo in hashing parsed Cargo.lock (#159)
Browse files Browse the repository at this point in the history
This simple mistake caused the entire `Cargo.lock` to be ignored (JS
treats having no return as `false`).

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Aug 10, 2023
1 parent b919e14 commit 4e0f4b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 4e0f4b1

Please sign in to comment.