From 509dd8ab4ccb00fa94a2fe4a73c6446b85a7e186 Mon Sep 17 00:00:00 2001 From: Titanium Brain Date: Thu, 23 Jul 2026 20:19:24 +0100 Subject: [PATCH] style(main): replace if else with catch --- src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index 492d49d..f22066e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -240,10 +240,10 @@ pub fn main(init: std.process.Init) !void { // Test for presence of Lua config file first // If it fails, fall back to ini var config_path = try std.Io.Dir.path.join(state.allocator, &[_][]const u8{ config_parent_path, "config.lua" }); - if (std.Io.Dir.accessAbsolute(state.io, config_path, .{})) |_| {} else |_| { + std.Io.Dir.accessAbsolute(state.io, config_path, .{}) catch { state.allocator.free(config_path); config_path = try std.Io.Dir.path.join(state.allocator, &[_][]const u8{ config_parent_path, "config.ini" }); - } + }; defer state.allocator.free(config_path); custom.binds = .empty;