refactor: minor changes
This commit is contained in:
1 parent
5d26493067
commit
f34ba63c81
1 file changed
+3
-6
+3
-6
@@ -47,14 +47,11 @@ pub fn main() !void {
|
||||
try stdout.print("ram: {d:.2} / {d:.2} GB ({}%)\n", .{ ram_info.ram_usage, ram_info.ram_size, ram_info.ram_usage_percentage });
|
||||
try bw.flush();
|
||||
|
||||
const swap_result = try os_module.getSwapInfo();
|
||||
switch (swap_result) {
|
||||
.swap_info => |s| {
|
||||
const swap_info = try os_module.getSwapInfo();
|
||||
if (swap_info) |s| {
|
||||
try stdout.print("Swap: {d:.2} / {d:.2} GB ({}%)\n", .{ s.swap_usage, s.swap_size, s.swap_usage_percentage });
|
||||
},
|
||||
.swap_disabled => {
|
||||
} else {
|
||||
try stdout.print("Swap: Disabled\n", .{});
|
||||
},
|
||||
}
|
||||
try bw.flush();
|
||||
|
||||
|
||||
Reference in new issue
Block a user