Function dupeStrings [src]
Duplicates an array of strings without the need to handle out of memory.
Prototype
pub fn dupeStrings(b: *Build, strings: []const []const u8) [][]u8
Parameters
b: *Build
strings: []const []const u8
Source
pub fn dupeStrings(b: *Build, strings: []const []const u8) [][]u8 {
const array = b.allocator.alloc([]u8, strings.len) catch @panic("OOM");
for (array, strings) |*dest, source| dest.* = b.dupe(source);
return array;
}