mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-09 15:19:13 +02:00
Remove pointless braces
Signed-off-by: AnErrupTion <anerruption+codeberg@disroot.org>
This commit is contained in:
parent
1241a0ac1e
commit
9a70efafd8
1 changed files with 2 additions and 6 deletions
|
|
@ -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});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue