diff --git a/river/SwitchMapping.zig b/river/SwitchMapping.zig index 2be8bfb..36fcee9 100644 --- a/river/SwitchMapping.zig +++ b/river/SwitchMapping.zig @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -const Self = @This(); +const SwitchMapping = @This(); const Switch = @import("Switch.zig"); const util = @import("util.zig"); @@ -27,21 +27,21 @@ pub fn init( switch_type: Switch.Type, switch_state: Switch.State, command_args: []const []const u8, -) !Self { +) !SwitchMapping { const owned_args = try util.gpa.alloc([:0]u8, command_args.len); errdefer util.gpa.free(owned_args); for (command_args, 0..) |arg, i| { errdefer for (owned_args[0..i]) |a| util.gpa.free(a); owned_args[i] = try util.gpa.dupeZ(u8, arg); } - return Self{ + return SwitchMapping{ .switch_type = switch_type, .switch_state = switch_state, .command_args = owned_args, }; } -pub fn deinit(self: Self) void { - for (self.command_args) |arg| util.gpa.free(arg); - util.gpa.free(self.command_args); +pub fn deinit(mapping: SwitchMapping) void { + for (mapping.command_args) |arg| util.gpa.free(arg); + util.gpa.free(mapping.command_args); }