From af64a8fb6f8d0651d1881166d79fccbc2c2872f3 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 14 Aug 2025 20:01:07 +0200 Subject: CommandContext: Remove execute_command. It was not properly typeable and it was null most of the time. --- src/cmd/lib/types.zig | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/cmd/lib') diff --git a/src/cmd/lib/types.zig b/src/cmd/lib/types.zig index 2d96295..5990511 100644 --- a/src/cmd/lib/types.zig +++ b/src/cmd/lib/types.zig @@ -67,28 +67,11 @@ pub const CommandContext = struct { output_capture: ?*OutputCapture, input_source: ?*InputSource, - // The real type is: - // - // const ExecuteCommandFn = *const fn (Command, Allocator, ?*OutputCapture, ?*InputSource) anyerror!CommandStatus; - // - // But Command is defined in ../cmd.zig, so we can't write it. - execute_command: ?*const anyopaque, // Will be cast to the appropriate function type when used - pub fn init(allocator: Allocator, output_capture: ?*OutputCapture, input_source: ?*InputSource) CommandContext { return CommandContext{ .allocator = allocator, .output_capture = output_capture, .input_source = input_source, - .execute_command = null, - }; - } - - pub fn with_executor(allocator: Allocator, output_capture: ?*OutputCapture, input_source: ?*InputSource, execute_command: anytype) CommandContext { - return CommandContext{ - .allocator = allocator, - .output_capture = output_capture, - .input_source = input_source, - .execute_command = @ptrCast(&execute_command), }; } }; -- cgit v1.2.1