style(main): replace if else with catch

This commit is contained in:
Titanium Brain 2026-07-23 20:19:24 +01:00
commit 509dd8ab4c

View file

@ -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;