mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 06:03:09 -05:00
build: in ZiglingStep.check_output
panic in case of OOM
This is necessary since, when trimLines returns `std.mem.Allocator.Error`, no error message will be displayed to the user. An alternative is to use `std.Build.Step.fail`, but using @panic("OOM") is simpler and consistent with existing code.
This commit is contained in:
parent
d0de9e5348
commit
3e38a4fc84
1 changed files with 1 additions and 1 deletions
|
@ -304,7 +304,7 @@ const ZiglingStep = struct {
|
||||||
// Validate the output.
|
// Validate the output.
|
||||||
// NOTE: exercise.output can never contain a CR character.
|
// NOTE: exercise.output can never contain a CR character.
|
||||||
// See https://ziglang.org/documentation/master/#Source-Encoding.
|
// See https://ziglang.org/documentation/master/#Source-Encoding.
|
||||||
const output = try trimLines(b.allocator, raw_output);
|
const output = trimLines(b.allocator, raw_output) catch @panic("OOM");
|
||||||
const exercise_output = self.exercise.output;
|
const exercise_output = self.exercise.output;
|
||||||
if (!std.mem.eql(u8, output, self.exercise.output)) {
|
if (!std.mem.eql(u8, output, self.exercise.output)) {
|
||||||
return self.step.fail(
|
return self.step.fail(
|
||||||
|
|
Loading…
Reference in a new issue