authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-10 14:00:55-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 12:15:04-07:00
log6b0d77326678d198550c0cc3ef7fe82a53e0e508
tree5fb748927dab65fb4f197139cc2b731cf0b50d98
parent3a8117439dce10a92e3c37a7dbf5440a9730ad41

std: clean up imports in a couple files


1 files changed, 10 insertions(+), 10 deletions(-)

lib/std/process.zig+10-10
......@@ -355,7 +355,7 @@ pub const GetEnvVarOwnedError = error{
355355};
356356
357357/// Caller must free returned memory.
358pub fn getEnvVarOwned(allocator: mem.Allocator, key: []const u8) GetEnvVarOwnedError![]u8 {
358pub fn getEnvVarOwned(allocator: Allocator, key: []const u8) GetEnvVarOwnedError![]u8 {
359359 if (builtin.os.tag == .windows) {
360360 const result_w = blk: {
361361 const key_w = try std.unicode.utf8ToUtf16LeWithNull(allocator, key);
......@@ -430,7 +430,7 @@ pub const ArgIteratorPosix = struct {
430430};
431431
432432pub const ArgIteratorWasi = struct {
433 allocator: mem.Allocator,
433 allocator: Allocator,
434434 index: usize,
435435 args: [][:0]u8,
436436
......@@ -438,7 +438,7 @@ pub const ArgIteratorWasi = struct {
438438
439439 /// You must call deinit to free the internal buffer of the
440440 /// iterator after you are done.
441 pub fn init(allocator: mem.Allocator) InitError!ArgIteratorWasi {
441 pub fn init(allocator: Allocator) InitError!ArgIteratorWasi {
442442 const fetched_args = try ArgIteratorWasi.internalInit(allocator);
443443 return ArgIteratorWasi{
444444 .allocator = allocator,
......@@ -447,7 +447,7 @@ pub const ArgIteratorWasi = struct {
447447 };
448448 }
449449
450 fn internalInit(allocator: mem.Allocator) InitError![][:0]u8 {
450 fn internalInit(allocator: Allocator) InitError![][:0]u8 {
451451 const w = os.wasi;
452452 var count: usize = undefined;
453453 var buf_size: usize = undefined;
......@@ -760,7 +760,7 @@ pub const ArgIterator = struct {
760760 };
761761
762762 /// You must deinitialize iterator's internal buffers by calling `deinit` when done.
763 pub fn initWithAllocator(allocator: mem.Allocator) InitError!ArgIterator {
763 pub fn initWithAllocator(allocator: Allocator) InitError!ArgIterator {
764764 if (builtin.os.tag == .wasi and !builtin.link_libc) {
765765 return ArgIterator{ .inner = try InnerType.init(allocator) };
766766 }
......@@ -804,7 +804,7 @@ pub fn args() ArgIterator {
804804}
805805
806806/// You must deinitialize iterator's internal buffers by calling `deinit` when done.
807pub fn argsWithAllocator(allocator: mem.Allocator) ArgIterator.InitError!ArgIterator {
807pub fn argsWithAllocator(allocator: Allocator) ArgIterator.InitError!ArgIterator {
808808 return ArgIterator.initWithAllocator(allocator);
809809}
810810
......@@ -827,7 +827,7 @@ test "args iterator" {
827827}
828828
829829/// Caller must call argsFree on result.
830pub fn argsAlloc(allocator: mem.Allocator) ![][:0]u8 {
830pub fn argsAlloc(allocator: Allocator) ![][:0]u8 {
831831 // TODO refactor to only make 1 allocation.
832832 var it = try argsWithAllocator(allocator);
833833 defer it.deinit();
......@@ -864,7 +864,7 @@ pub fn argsAlloc(allocator: mem.Allocator) ![][:0]u8 {
864864 return result_slice_list;
865865}
866866
867pub fn argsFree(allocator: mem.Allocator, args_alloc: []const [:0]u8) void {
867pub fn argsFree(allocator: Allocator, args_alloc: []const [:0]u8) void {
868868 var total_bytes: usize = 0;
869869 for (args_alloc) |arg| {
870870 total_bytes += @sizeOf([]u8) + arg.len + 1;
......@@ -1089,7 +1089,7 @@ pub const ExecvError = std.os.ExecveError || error{OutOfMemory};
10891089/// This function also uses the PATH environment variable to get the full path to the executable.
10901090/// Due to the heap-allocation, it is illegal to call this function in a fork() child.
10911091/// For that use case, use the `std.os` functions directly.
1092pub fn execv(allocator: mem.Allocator, argv: []const []const u8) ExecvError {
1092pub fn execv(allocator: Allocator, argv: []const []const u8) ExecvError {
10931093 return execve(allocator, argv, null);
10941094}
10951095
......@@ -1102,7 +1102,7 @@ pub fn execv(allocator: mem.Allocator, argv: []const []const u8) ExecvError {
11021102/// Due to the heap-allocation, it is illegal to call this function in a fork() child.
11031103/// For that use case, use the `std.os` functions directly.
11041104pub fn execve(
1105 allocator: mem.Allocator,
1105 allocator: Allocator,
11061106 argv: []const []const u8,
11071107 env_map: ?*const EnvMap,
11081108) ExecvError {