Skip to content

Commit 65018e9

Browse files
committed
Simplify
1 parent 094edc0 commit 65018e9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tools/verify-rust-version.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const cargo_toml_rust_version = cargo_toml_src.split('\n').filter(l => l.startsW
1818

1919
console.log(`Rust version: ${cargo_toml_rust_version}`);
2020

21-
let exitCode = 0; // Non zero code indicates error
22-
2321
for (const file of files) {
2422
const file_content = fs.readFileSync(file, 'UTF8').toString();
2523
const matches1 = file_content.match(re1);
@@ -29,7 +27,7 @@ for (const file of files) {
2927
for (const match of matches1) {
3028
if (match !== cargo_toml_rust_version.substring(0, 4)) {
3129
console.error(`Found reference to version ${match}, expected ${cargo_toml_rust_version} in file ${file}`);
32-
exitCode = 1;
30+
proc.exitCode = 1; // Non zero code indicates error
3331
}
3432
}
3533
}
@@ -38,11 +36,9 @@ for (const file of files) {
3836
for (const match of matches2) {
3937
if (match !== cargo_toml_rust_version) {
4038
console.error(`Found reference to version ${match}, expected ${cargo_toml_rust_version} in ${file}`);
41-
exitCode = 1;
39+
proc.exitCode = 1; // Non zero code indicates error
4240
}
4341
}
4442
}
4543

4644
}
47-
48-
proc.exitCode = exitCode;

0 commit comments

Comments
 (0)