mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
hash mismatch error: don't make empty such a special case
we can more simply use quotes instead
This commit is contained in:
parent
8f7fc63847
commit
bc3ce4b971
1 changed files with 4 additions and 6 deletions
|
|
@ -567,18 +567,16 @@ fn runResource(
|
|||
if (declared_hash.isOld()) {
|
||||
const actual_hex = Package.multiHashHexDigest(f.computed_hash.digest);
|
||||
if (!std.mem.eql(u8, declared_hash.toSlice(), &actual_hex)) {
|
||||
const declared = if (declared_hash.toSlice().len > 0) declared_hash.toSlice() else "<empty>";
|
||||
return f.fail(hash_tok, try eb.printString(
|
||||
"hash mismatch: manifest declares {s} but the fetched package has {s}",
|
||||
.{ declared, actual_hex },
|
||||
"hash mismatch: manifest declares '{s}' but the fetched package has '{s}'",
|
||||
.{ declared_hash.toSlice(), actual_hex },
|
||||
));
|
||||
}
|
||||
} else {
|
||||
if (!computed_package_hash.eql(&declared_hash)) {
|
||||
const declared = if (declared_hash.toSlice().len > 0) declared_hash.toSlice() else "<empty>";
|
||||
return f.fail(hash_tok, try eb.printString(
|
||||
"hash mismatch: manifest declares {s} but the fetched package has {s}",
|
||||
.{ declared, computed_package_hash.toSlice() },
|
||||
"hash mismatch: manifest declares '{s}' but the fetched package has '{s}'",
|
||||
.{ declared_hash.toSlice(), computed_package_hash.toSlice() },
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue