refactor(linux): change toStr string

This commit is contained in:
utox39
2025-05-10 19:31:13 +02:00
parent c541e0588e
commit 360fe05007
3 changed files with 7 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ pub const CpuInfo = struct {
cpu_max_freq: f32,
pub fn toStr(self: CpuInfo, buf: []u8) ![]u8 {
return std.fmt.bufPrint(buf, "Cpu: {s} ({}) @ {d:.2} GHz", .{ self.cpu_name, self.cpu_cores, self.cpu_max_freq });
return std.fmt.bufPrint(buf, "{s} ({}) @ {d:.2} GHz", .{ self.cpu_name, self.cpu_cores, self.cpu_max_freq });
}
};
@@ -18,7 +18,7 @@ pub const RamInfo = struct {
ram_usage_percentage: u8,
pub fn toStr(self: RamInfo, buf: []u8) ![]u8 {
return std.fmt.bufPrint(buf, "Ram: {d:.2} / {d:.2} GiB ({}%)", .{ self.ram_usage, self.ram_size, self.ram_usage_percentage });
return std.fmt.bufPrint(buf, "{d:.2} / {d:.2} GiB ({}%)", .{ self.ram_usage, self.ram_size, self.ram_usage_percentage });
}
};
@@ -28,7 +28,7 @@ pub const SwapInfo = struct {
swap_usage_percentage: u8,
pub fn toStr(self: SwapInfo, buf: []u8) ![]u8 {
return std.fmt.bufPrint(buf, "Swap: {d:.2} / {d:.2} GiB ({}%)", .{ self.swap_usage, self.swap_size, self.swap_usage_percentage });
return std.fmt.bufPrint(buf, "{d:.2} / {d:.2} GiB ({}%)", .{ self.swap_usage, self.swap_size, self.swap_usage_percentage });
}
};
@@ -39,7 +39,7 @@ pub const DiskInfo = struct {
disk_usage_percentage: u8,
pub fn toStr(self: DiskInfo, buf: []u8) ![]u8 {
return std.fmt.bufPrint(buf, "Disk ({s}): {d:.2} / {d:.2} GB ({}%)", .{ self.disk_path, self.disk_usage, self.disk_size, self.disk_usage_percentage });
return std.fmt.bufPrint(buf, "({s}): {d:.2} / {d:.2} GB ({}%)", .{ self.disk_path, self.disk_usage, self.disk_size, self.disk_usage_percentage });
}
};