diff --git a/src/linux/system.zig b/src/linux/system.zig index 7d6ee14..b895902 100644 --- a/src/linux/system.zig +++ b/src/linux/system.zig @@ -122,8 +122,7 @@ pub fn getWindowManagerInfo(allocator: std.mem.Allocator) ![]const u8 { // NOTE: https://stackoverflow.com/questions/23534263/what-is-the-maximum-allowed-limit-on-the-length-of-a-process-name var file_buf: [16]u8 = undefined; - var reader = std.fs.File.Reader.init(file, &file_buf); - const read = try reader.read(&file_buf); + const read = try file.read(&file_buf); const proc_name = file_buf[0..read]; const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n"); diff --git a/src/utils.zig b/src/utils.zig index 8721cf4..6b85114 100644 --- a/src/utils.zig +++ b/src/utils.zig @@ -119,8 +119,7 @@ pub fn readFile(allocator: std.mem.Allocator, file: std.fs.File, size: usize) ![ var file_buf = try allocator.alloc(u8, size); defer allocator.free(file_buf); - var reader = std.fs.File.Reader.init(file, file_buf); - const read = try reader.read(file_buf); + const read = try file.read(file_buf); const data = file_buf[0..read];