diff --git a/src/subprocess.zig b/src/subprocess.zig index d7bddf0..7a2ee03 100644 --- a/src/subprocess.zig +++ b/src/subprocess.zig @@ -145,9 +145,9 @@ const Proc = struct { fn receive(self: *Proc, _: tp.pid_ref, m: tp.message) tp.result { errdefer self.deinit(); - var bytes: []u8 = ""; + var bytes: []const u8 = ""; var err: i64 = 0; - var err_msg: []u8 = ""; + var err_msg: []const u8 = ""; if (try m.match(.{ "fd", "stdout", "read_ready" })) { try self.dispatch_stdout(); if (self.fd_stdout) |fd_stdout| fd_stdout.wait_read() catch |e| return self.handle_error(e); diff --git a/src/thespian.zig b/src/thespian.zig index 7a476b5..136937d 100644 --- a/src/thespian.zig +++ b/src/thespian.zig @@ -499,14 +499,14 @@ fn log_last_error(err: anytype) @TypeOf(err) { fn exitHandlerRun(comptime T: type) c.thespian_exit_handler { if (T == @TypeOf(null)) return null; return switch (@typeInfo(T)) { - .Optional => |info| switch (@typeInfo(info.child)) { - .Pointer => |ptr_info| switch (ptr_info.size) { - .One => ptr_info.child.run, + .optional => |info| switch (@typeInfo(info.child)) { + .pointer => |ptr_info| switch (ptr_info.size) { + .one => ptr_info.child.run, else => @compileError("expected single item pointer, found: '" ++ @typeName(T) ++ "'"), }, }, - .Pointer => |ptr_info| switch (ptr_info.size) { - .One => ptr_info.child.run, + .pointer => |ptr_info| switch (ptr_info.size) { + .one => ptr_info.child.run, else => @compileError("expected single item pointer, found: '" ++ @typeName(T) ++ "'"), }, else => @compileError("expected optional pointer or pointer type, found: '" ++ @typeName(T) ++ "'"), @@ -515,8 +515,8 @@ fn exitHandlerRun(comptime T: type) c.thespian_exit_handler { pub fn receive(r: anytype) void { const T = switch (@typeInfo(@TypeOf(r))) { - .Pointer => |ptr_info| switch (ptr_info.size) { - .One => ptr_info.child, + .pointer => |ptr_info| switch (ptr_info.size) { + .one => ptr_info.child, else => @compileError("invalid receiver type"), }, else => @compileError("invalid receiver type"),