mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-09 00:09:59 +00:00
Fix zig 0.15.0-dev.1149+4e6a04929 build errors
This commit is contained in:
@@ -161,7 +161,8 @@ const CheckNamedStep = struct {
|
||||
);
|
||||
defer stderr_file.close();
|
||||
|
||||
const stderr = stderr_file.reader();
|
||||
var buffer: [4096]u8 = undefined;
|
||||
const stderr = stderr_file.reader(&buffer);
|
||||
{
|
||||
// Skip the logo.
|
||||
const nlines = mem.count(u8, root.logo, "\n");
|
||||
@@ -213,7 +214,8 @@ const CheckStep = struct {
|
||||
);
|
||||
defer stderr_file.close();
|
||||
|
||||
const stderr = stderr_file.reader();
|
||||
var buffer: [4096]u8 = undefined;
|
||||
const stderr = stderr_file.reader(&buffer);
|
||||
for (exercises) |ex| {
|
||||
if (ex.number() == 1) {
|
||||
// Skip the logo.
|
||||
@@ -298,7 +300,7 @@ fn check(
|
||||
}
|
||||
|
||||
fn readLine(reader: fs.File.Reader, buf: []u8) !?[]const u8 {
|
||||
if (try reader.readUntilDelimiterOrEof(buf, '\n')) |line| {
|
||||
if (try reader.file.deprecatedReader().readUntilDelimiterOrEof(buf, '\n')) |line| {
|
||||
return mem.trimRight(u8, line, " \r\n");
|
||||
}
|
||||
|
||||
@@ -405,7 +407,8 @@ fn heal(allocator: Allocator, exercises: []const Exercise, work_path: []const u8
|
||||
/// difference that returns an error when the temp path cannot be created.
|
||||
pub fn makeTempPath(b: *Build) ![]const u8 {
|
||||
const rand_int = std.crypto.random.int(u64);
|
||||
const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ Build.hex64(rand_int);
|
||||
const rand_hex64 = std.fmt.hex(rand_int);
|
||||
const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ rand_hex64;
|
||||
const path = b.cache_root.join(b.allocator, &.{tmp_dir_sub_path}) catch
|
||||
@panic("OOM");
|
||||
try b.cache_root.handle.makePath(tmp_dir_sub_path);
|
||||
|
||||
Reference in New Issue
Block a user