Syntax for a literal of type []const []const u8

i’m currently calling std.fs.path.join as follows:

const arr = [_][]const u8{ path, suffix };
std.fs.path.join(allocator, arr); 

can i express this call as a “one-liner” ???

[[a special shout-out to @tensorush in this answer for even getting me this far]]

1 Like

Sure, this should work.

const joined_path = try std.fs.path.join(allocator, &.{ path, suffix }); 
2 Likes