mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-21 21:53:11 -05:00
Calling split
is deprecated
The `split` function in std mem is depreacted and a `@compileError`, splitSequence, splitAny, or splitScalar should be used instead.
This commit is contained in:
parent
6d3d3651d0
commit
83f16709ba
1 changed files with 2 additions and 2 deletions
|
@ -459,7 +459,7 @@ fn resetLine() void {
|
||||||
pub fn trimLines(allocator: std.mem.Allocator, buf: []const u8) ![]const u8 {
|
pub fn trimLines(allocator: std.mem.Allocator, buf: []const u8) ![]const u8 {
|
||||||
var list = try std.ArrayList(u8).initCapacity(allocator, buf.len);
|
var list = try std.ArrayList(u8).initCapacity(allocator, buf.len);
|
||||||
|
|
||||||
var iter = std.mem.split(u8, buf, " \n");
|
var iter = std.mem.splitSequence(u8, buf, " \n");
|
||||||
while (iter.next()) |line| {
|
while (iter.next()) |line| {
|
||||||
// TODO: trimming CR characters is probably not necessary.
|
// TODO: trimming CR characters is probably not necessary.
|
||||||
const data = std.mem.trimRight(u8, line, " \r");
|
const data = std.mem.trimRight(u8, line, " \r");
|
||||||
|
@ -521,7 +521,7 @@ fn validate_exercises() bool {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var iter = std.mem.split(u8, ex.output, "\n");
|
var iter = std.mem.splitScalar(u8, ex.output, '\n');
|
||||||
while (iter.next()) |line| {
|
while (iter.next()) |line| {
|
||||||
const output = std.mem.trimRight(u8, line, " \r");
|
const output = std.mem.trimRight(u8, line, " \r");
|
||||||
if (output.len != line.len) {
|
if (output.len != line.len) {
|
||||||
|
|
Loading…
Reference in a new issue