std.Build: avoid use of catch unreachable
Usage of `catch unreachable` in build scripts is completely harmless because build scripts are always run in Debug mode, however, it sets a poor example for beginners to learn from.
This commit is contained in:
@@ -18,7 +18,7 @@ pub fn create(
|
||||
source: std.Build.FileSource,
|
||||
expected_matches: []const []const u8,
|
||||
) *CheckFileStep {
|
||||
const self = builder.allocator.create(CheckFileStep) catch unreachable;
|
||||
const self = builder.allocator.create(CheckFileStep) catch @panic("OOM");
|
||||
self.* = CheckFileStep{
|
||||
.builder = builder,
|
||||
.step = Step.init(.check_file, "CheckFile", builder.allocator, make),
|
||||
|
||||
Reference in New Issue
Block a user