The std.fs.File.Reader.read function was removed in Zig v0.15.2.
This commit is contained in:
@@ -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
|
// 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 file_buf: [16]u8 = undefined;
|
||||||
var reader = std.fs.File.Reader.init(file, &file_buf);
|
const read = try file.read(&file_buf);
|
||||||
const read = try reader.read(&file_buf);
|
|
||||||
const proc_name = file_buf[0..read];
|
const proc_name = file_buf[0..read];
|
||||||
|
|
||||||
const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n");
|
const proc_name_trimmed = std.mem.trim(u8, proc_name, "\n");
|
||||||
|
|||||||
@@ -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);
|
var file_buf = try allocator.alloc(u8, size);
|
||||||
defer allocator.free(file_buf);
|
defer allocator.free(file_buf);
|
||||||
|
|
||||||
var reader = std.fs.File.Reader.init(file, file_buf);
|
const read = try file.read(file_buf);
|
||||||
const read = try reader.read(file_buf);
|
|
||||||
|
|
||||||
const data = file_buf[0..read];
|
const data = file_buf[0..read];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user