Okay, unconst it I guess

This commit is contained in:
Lyssieth 2026-01-06 08:14:53 +02:00
parent 7477e55349
commit 1e8d0ca852
Signed by untrusted user who does not match committer: lyssieth
GPG key ID: 6EE87E973D3AA8F2

View file

@ -59,14 +59,14 @@ pub fn parseArgs(comptime T: type, allocator: Allocator) !T {
const args = try std.process.argsAlloc(allocator);
defer std.process.argsFree(allocator, args);
return parseArgsFromSlice(T, allocator, @constCast(args[1..]));
return parseArgsFromSlice(T, allocator, args[1..]);
}
/// All items of `args` must be valid, otherwise you will get a General Protection Fault.
/// Do not pass the process name as an argument.
///
/// Parsing order of arguments is based on the order they are declared in `T`.
pub fn parseArgsFromSlice(comptime T: type, allocator: Allocator, args: [][:0]const u8) !T {
pub fn parseArgsFromSlice(comptime T: type, allocator: Allocator, args: [][:0]u8) !T {
var flags = try std.ArrayList(Arg).initCapacity(allocator, 4);
defer flags.deinit(allocator);