std.process.Args: make toSlice return mutable slice

Change return type from `[]const [:0]const u8` to
`[][:0]const u8` to allow in-place reordering of arguments.

Signed-off-by: Pablo Alessandro Santos Hugen <phugen@redhat.com>
This commit is contained in:
Pablo Alessandro Santos Hugen 2026-01-22 17:33:15 -03:00 committed by Alex Rønne Petersen
parent 813727623f
commit b488ee7ec1

View file

@ -476,7 +476,7 @@ pub const ToSliceError = Iterator.Windows.InitError || Iterator.Wasi.InitError;
/// See also:
/// * `iterate`
/// * `iterateAllocator`
pub fn toSlice(a: Args, arena: Allocator) ToSliceError![]const [:0]const u8 {
pub fn toSlice(a: Args, arena: Allocator) ToSliceError![][:0]const u8 {
if (native_os == .windows) {
var it = try a.iterateAllocator(arena);
var contents: std.ArrayList(u8) = .empty;