From 9a70efafd8e8875cdb0d64943421c2f8c8c235af Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sun, 5 Jul 2026 21:08:08 +0200 Subject: [PATCH] Remove pointless braces Signed-off-by: AnErrupTion --- src/main.zig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.zig b/src/main.zig index 2960228..0e99915 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2325,13 +2325,9 @@ fn getBatteryPercentage(io: std.Io, battery_id: []const u8) !u8 { const ret = sysctl.sysctlbyname("hw.acpi.battery.life", &capacity, &size, null, 0); - if (ret != 0) { - return error.SysctlFailed; - } + if (ret != 0) return error.SysctlFailed; + if (capacity < 0 or capacity > 100) return error.InvalidBatteryCapacity; - if (capacity < 0 or capacity > 100) { - return error.InvalidBatteryCapacity; - } return @intCast(capacity); } else { const path = try std.fmt.allocPrint(temporary_allocator, "/sys/class/power_supply/{s}/capacity", .{battery_id});