Remove pointless braces

Signed-off-by: AnErrupTion <anerruption+codeberg@disroot.org>
This commit is contained in:
AnErrupTion 2026-07-05 21:08:08 +02:00
commit 9a70efafd8

View file

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