authorgravatar for sorairolake@protonmail.chShun Sakai <sorairolake@protonmail.ch> 2025-04-27 18:03:59+09:00
committergravatar for sorairolake@protonmail.chShun Sakai <sorairolake@protonmail.ch> 2025-04-27 18:03:59+09:00
log5fc4448e451d7a8e184ac5fbe1e954bff653e36d
treec6f738489cc02ba2478a117b86088f77d0935aea
parent3783b1b23c056b30923d6c9dbd2e44c499738198

chore(std.mem): Rename `trimLeft` and `trimRight`

Rename `trimLeft` to `trimStart`, and `trimRight` to `trimEnd`. `trimLeft` and `trimRight` functions remain as deprecated aliases for these new names.

22 files changed, 61 insertions(+), 47 deletions(-)

lib/compiler/resinator/compile.zig+1-1
......@@ -3274,7 +3274,7 @@ pub const StringTable = struct {
32743274 // Note: This is only the case for STRINGTABLE strings
32753275 const trimmed = trimToDoubleNUL(u16, utf16_string);
32763276 // We also want to trim any trailing NUL characters
3277 break :trim std.mem.trimRight(u16, trimmed, &[_]u16{0});
3277 break :trim std.mem.trimEnd(u16, trimmed, &[_]u16{0});
32783278 };
32793279
32803280 // String literals are limited to maxInt(u15) codepoints, so these UTF-16 encoded
lib/docs/wasm/markdown/Parser.zig+5-5
......@@ -140,7 +140,7 @@ const Block = struct {
140140 /// (e.g. for a blockquote, this would be everything except the leading
141141 /// `>`). If unsuccessful, returns null.
142142 fn match(b: Block, line: []const u8) ?[]const u8 {
143 const unindented = mem.trimLeft(u8, line, " \t");
143 const unindented = mem.trimStart(u8, line, " \t");
144144 const indent = line.len - unindented.len;
145145 return switch (b.tag) {
146146 .list => line,
......@@ -156,7 +156,7 @@ const Block = struct {
156156 .table_row => null,
157157 .heading => null,
158158 .code_block => code_block: {
159 const trimmed = mem.trimRight(u8, unindented, " \t");
159 const trimmed = mem.trimEnd(u8, unindented, " \t");
160160 if (mem.indexOfNone(u8, trimmed, "`") != null or trimmed.len != b.data.code_block.fence_len) {
161161 const effective_indent = @min(indent, b.data.code_block.indent);
162162 break :code_block line[effective_indent..];
......@@ -225,7 +225,7 @@ pub fn feedLine(p: *Parser, line: []const u8) Allocator.Error!void {
225225 p.pending_blocks.items.len > 0 and
226226 p.pending_blocks.getLast().tag == .paragraph)
227227 {
228 try p.addScratchStringLine(mem.trimLeft(u8, rest_line, " \t"));
228 try p.addScratchStringLine(mem.trimStart(u8, rest_line, " \t"));
229229 return;
230230 }
231231
......@@ -261,7 +261,7 @@ pub fn feedLine(p: *Parser, line: []const u8) Allocator.Error!void {
261261 last_pending_block.canAccept()
262262 else
263263 .blocks;
264 const rest_line_trimmed = mem.trimLeft(u8, rest_line, " \t");
264 const rest_line_trimmed = mem.trimStart(u8, rest_line, " \t");
265265 switch (can_accept) {
266266 .blocks => {
267267 // If we're inside a list item and the rest of the line is blank, it
......@@ -500,7 +500,7 @@ fn appendBlockStart(p: *Parser, block_start: BlockStart) !void {
500500}
501501
502502fn startBlock(p: *Parser, line: []const u8) !?BlockStart {
503 const unindented = mem.trimLeft(u8, line, " \t");
503 const unindented = mem.trimStart(u8, line, " \t");
504504 const indent = line.len - unindented.len;
505505 if (isThematicBreak(line)) {
506506 // Thematic breaks take precedence over list items.
lib/std/crypto/tls/Client.zig+2-2
......@@ -364,7 +364,7 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
364364 };
365365 P.AEAD.decrypt(cleartext, ciphertext, auth_tag, record_header, nonce, pv.server_handshake_key) catch
366366 return error.TlsBadRecordMac;
367 cleartext_fragment_end += std.mem.trimRight(u8, cleartext, "\x00").len;
367 cleartext_fragment_end += std.mem.trimEnd(u8, cleartext, "\x00").len;
368368 },
369369 }
370370 read_seq += 1;
......@@ -1353,7 +1353,7 @@ pub fn readvAdvanced(c: *Client, stream: anytype, iovecs: []const std.posix.iove
13531353 const cleartext = cleartext_buf[0..ciphertext.len];
13541354 P.AEAD.decrypt(cleartext, ciphertext, auth_tag, ad, nonce, pv.server_key) catch
13551355 return error.TlsBadRecordMac;
1356 const msg = mem.trimRight(u8, cleartext, "\x00");
1356 const msg = mem.trimEnd(u8, cleartext, "\x00");
13571357 break :cleartext .{ msg[0 .. msg.len - 1], @enumFromInt(msg[msg.len - 1]) };
13581358 },
13591359 .tls_1_2 => {
lib/std/elf.zig+3-3
......@@ -2330,12 +2330,12 @@ pub const ar_hdr = extern struct {
23302330 ar_fmag: [2]u8,
23312331
23322332 pub fn date(self: ar_hdr) std.fmt.ParseIntError!u64 {
2333 const value = mem.trimRight(u8, &self.ar_date, &[_]u8{0x20});
2333 const value = mem.trimEnd(u8, &self.ar_date, &[_]u8{0x20});
23342334 return std.fmt.parseInt(u64, value, 10);
23352335 }
23362336
23372337 pub fn size(self: ar_hdr) std.fmt.ParseIntError!u32 {
2338 const value = mem.trimRight(u8, &self.ar_size, &[_]u8{0x20});
2338 const value = mem.trimEnd(u8, &self.ar_size, &[_]u8{0x20});
23392339 return std.fmt.parseInt(u32, value, 10);
23402340 }
23412341
......@@ -2369,7 +2369,7 @@ pub const ar_hdr = extern struct {
23692369 pub fn nameOffset(self: ar_hdr) std.fmt.ParseIntError!?u32 {
23702370 const value = &self.ar_name;
23712371 if (value[0] != '/') return null;
2372 const trimmed = mem.trimRight(u8, value, &[_]u8{0x20});
2372 const trimmed = mem.trimEnd(u8, value, &[_]u8{0x20});
23732373 return try std.fmt.parseInt(u32, trimmed[1..], 10);
23742374 }
23752375};
lib/std/fmt.zig+1-1
......@@ -1162,7 +1162,7 @@ pub fn formatFloatHexadecimal(
11621162
11631163 try writer.writeAll("0x");
11641164 try writer.writeByte(buf[0]);
1165 const trimmed = mem.trimRight(u8, buf[1..], "0");
1165 const trimmed = mem.trimEnd(u8, buf[1..], "0");
11661166 if (options.precision) |precision| {
11671167 if (precision > 0) try writer.writeAll(".");
11681168 } else if (trimmed.len > 0) {
lib/std/http/Client.zig+1-1
......@@ -473,7 +473,7 @@ pub const Response = struct {
473473 };
474474 if (first_line[8] != ' ') return error.HttpHeadersInvalid;
475475 const status: http.Status = @enumFromInt(parseInt3(first_line[9..12]));
476 const reason = mem.trimLeft(u8, first_line[12..], " ");
476 const reason = mem.trimStart(u8, first_line[12..], " ");
477477
478478 res.version = version;
479479 res.status = status;
lib/std/mem.zig+18-4
......@@ -1198,19 +1198,33 @@ pub fn allEqual(comptime T: type, slice: []const T, scalar: T) bool {
11981198}
11991199
12001200/// Remove a set of values from the beginning of a slice.
1201pub fn trimLeft(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
1201pub fn trimStart(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
12021202 var begin: usize = 0;
12031203 while (begin < slice.len and indexOfScalar(T, values_to_strip, slice[begin]) != null) : (begin += 1) {}
12041204 return slice[begin..];
12051205}
12061206
1207test trimStart {
1208 try testing.expectEqualSlices(u8, "foo\n ", trimStart(u8, " foo\n ", " \n"));
1209}
1210
1211/// Deprecated: use `trimStart` instead.
1212pub const trimLeft = trimStart;
1213
12071214/// Remove a set of values from the end of a slice.
1208pub fn trimRight(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
1215pub fn trimEnd(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
12091216 var end: usize = slice.len;
12101217 while (end > 0 and indexOfScalar(T, values_to_strip, slice[end - 1]) != null) : (end -= 1) {}
12111218 return slice[0..end];
12121219}
12131220
1221test trimEnd {
1222 try testing.expectEqualSlices(u8, " foo", trimEnd(u8, " foo\n ", " \n"));
1223}
1224
1225/// Deprecated: use `trimEnd` instead.
1226pub const trimRight = trimEnd;
1227
12141228/// Remove a set of values from the beginning and end of a slice.
12151229pub fn trim(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
12161230 var begin: usize = 0;
......@@ -1221,8 +1235,8 @@ pub fn trim(comptime T: type, slice: []const T, values_to_strip: []const T) []co
12211235}
12221236
12231237test trim {
1224 try testing.expectEqualSlices(u8, "foo\n ", trimLeft(u8, " foo\n ", " \n"));
1225 try testing.expectEqualSlices(u8, " foo", trimRight(u8, " foo\n ", " \n"));
1238 try testing.expectEqualSlices(u8, "foo\n ", trimStart(u8, " foo\n ", " \n"));
1239 try testing.expectEqualSlices(u8, " foo", trimEnd(u8, " foo\n ", " \n"));
12261240 try testing.expectEqualSlices(u8, "foo", trim(u8, " foo\n ", " \n"));
12271241 try testing.expectEqualSlices(u8, "foo", trim(u8, "foo", " \n"));
12281242}
lib/std/tar.zig+2-2
......@@ -250,8 +250,8 @@ const Header = struct {
250250 const raw = header.bytes[start..][0..len];
251251 // Zero-filled octal number in ASCII. Each numeric field of width w
252252 // contains w minus 1 digits, and a null
253 const ltrimmed = std.mem.trimLeft(u8, raw, "0 ");
254 const rtrimmed = std.mem.trimRight(u8, ltrimmed, " \x00");
253 const ltrimmed = std.mem.trimStart(u8, raw, "0 ");
254 const rtrimmed = std.mem.trimEnd(u8, ltrimmed, " \x00");
255255 if (rtrimmed.len == 0) return 0;
256256 return std.fmt.parseInt(u64, rtrimmed, 8) catch return error.TarHeader;
257257 }
lib/std/zig/LibCInstallation.zig+1-1
......@@ -317,7 +317,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F
317317 while (path_i < search_paths.items.len) : (path_i += 1) {
318318 // search in reverse order
319319 const search_path_untrimmed = search_paths.items[search_paths.items.len - path_i - 1];
320 const search_path = std.mem.trimLeft(u8, search_path_untrimmed, " ");
320 const search_path = std.mem.trimStart(u8, search_path_untrimmed, " ");
321321 var search_dir = fs.cwd().openDir(search_path, .{}) catch |err| switch (err) {
322322 error.FileNotFound,
323323 error.NotDir,
lib/std/zig/Parse.zig+1-1
......@@ -1849,7 +1849,7 @@ fn parseTypeExpr(p: *Parse) Error!?Node.Index {
18491849 var sentinel: ?Node.Index = null;
18501850 if (p.eatToken(.identifier)) |ident| {
18511851 const ident_slice = p.source[p.tokenStart(ident)..p.tokenStart(ident + 1)];
1852 if (!std.mem.eql(u8, std.mem.trimRight(u8, ident_slice, &std.ascii.whitespace), "c")) {
1852 if (!std.mem.eql(u8, std.mem.trimEnd(u8, ident_slice, &std.ascii.whitespace), "c")) {
18531853 p.tok_i -= 1;
18541854 }
18551855 } else if (p.eatToken(.colon)) |_| {
lib/std/zig/render.zig+3-3
......@@ -2955,7 +2955,7 @@ fn renderComments(r: *Render, start: usize, end: usize) Error!bool {
29552955 const newline = if (newline_index) |i| comment_start + i else null;
29562956
29572957 const untrimmed_comment = tree.source[comment_start .. newline orelse tree.source.len];
2958 const trimmed_comment = mem.trimRight(u8, untrimmed_comment, &std.ascii.whitespace);
2958 const trimmed_comment = mem.trimEnd(u8, untrimmed_comment, &std.ascii.whitespace);
29592959
29602960 // Don't leave any whitespace at the start of the file
29612961 if (index != 0) {
......@@ -2976,7 +2976,7 @@ fn renderComments(r: *Render, start: usize, end: usize) Error!bool {
29762976
29772977 index = 1 + (newline orelse end - 1);
29782978
2979 const comment_content = mem.trimLeft(u8, trimmed_comment["//".len..], &std.ascii.whitespace);
2979 const comment_content = mem.trimStart(u8, trimmed_comment["//".len..], &std.ascii.whitespace);
29802980 if (ais.disabled_offset != null and mem.eql(u8, comment_content, "zig fmt: on")) {
29812981 // Write the source for which formatting was disabled directly
29822982 // to the underlying writer, fixing up invalid whitespace.
......@@ -3103,7 +3103,7 @@ fn tokenSliceForRender(tree: Ast, token_index: Ast.TokenIndex) []const u8 {
31033103 var ret = tree.tokenSlice(token_index);
31043104 switch (tree.tokenTag(token_index)) {
31053105 .container_doc_comment, .doc_comment => {
3106 ret = mem.trimRight(u8, ret, &std.ascii.whitespace);
3106 ret = mem.trimEnd(u8, ret, &std.ascii.whitespace);
31073107 },
31083108 else => {},
31093109 }
lib/std/zig/system.zig+2-2
......@@ -1182,13 +1182,13 @@ fn detectAbiAndDynamicLinker(
11821182 // We detected shebang, now parse entire line.
11831183
11841184 // Trim leading "#!", spaces and tabs.
1185 const trimmed_line = mem.trimLeft(u8, content[2..], &.{ ' ', '\t' });
1185 const trimmed_line = mem.trimStart(u8, content[2..], &.{ ' ', '\t' });
11861186
11871187 // This line can have:
11881188 // * Interpreter path only,
11891189 // * Interpreter path and arguments, all separated by space, tab or NUL character.
11901190 // And optionally newline at the end.
1191 const path_maybe_args = mem.trimRight(u8, trimmed_line, "\n");
1191 const path_maybe_args = mem.trimEnd(u8, trimmed_line, "\n");
11921192
11931193 // Separate path and args.
11941194 const path_end = mem.indexOfAny(u8, path_maybe_args, &.{ ' ', '\t', 0 }) orelse path_maybe_args.len;
lib/std/zig/system/darwin.zig+1-1
......@@ -59,7 +59,7 @@ pub fn getSdk(allocator: Allocator, target: Target) ?[]const u8 {
5959 .Exited => |code| if (code != 0) return null,
6060 else => return null,
6161 }
62 return allocator.dupe(u8, mem.trimRight(u8, result.stdout, "\r\n")) catch null;
62 return allocator.dupe(u8, mem.trimEnd(u8, result.stdout, "\r\n")) catch null;
6363}
6464
6565test {
lib/std/zig/system/linux.zig+2-2
......@@ -362,8 +362,8 @@ fn CpuinfoParser(comptime impl: anytype) type {
362362 while (true) {
363363 const line = (try reader.readUntilDelimiterOrEof(&line_buf, '\n')) orelse break;
364364 const colon_pos = mem.indexOfScalar(u8, line, ':') orelse continue;
365 const key = mem.trimRight(u8, line[0..colon_pos], " \t");
366 const value = mem.trimLeft(u8, line[colon_pos + 1 ..], " \t");
365 const key = mem.trimEnd(u8, line[0..colon_pos], " \t");
366 const value = mem.trimStart(u8, line[colon_pos + 1 ..], " \t");
367367
368368 if (!try obj.line_hook(key, value))
369369 break;
src/link.zig+1-1
......@@ -192,7 +192,7 @@ pub const Diags = struct {
192192 current_err.?.* = .{ .msg = duped_msg };
193193 } else if (current_err != null) {
194194 const context_prefix = ">>> ";
195 var trimmed = mem.trimRight(u8, line, &std.ascii.whitespace);
195 var trimmed = mem.trimEnd(u8, line, &std.ascii.whitespace);
196196 if (mem.startsWith(u8, trimmed, context_prefix)) {
197197 trimmed = trimmed[context_prefix.len..];
198198 }
src/link/MachO/Archive.zig+3-3
......@@ -159,12 +159,12 @@ pub const ar_hdr = extern struct {
159159 ar_fmag: [2]u8,
160160
161161 fn date(self: ar_hdr) !u64 {
162 const value = mem.trimRight(u8, &self.ar_date, &[_]u8{@as(u8, 0x20)});
162 const value = mem.trimEnd(u8, &self.ar_date, &[_]u8{@as(u8, 0x20)});
163163 return std.fmt.parseInt(u64, value, 10);
164164 }
165165
166166 fn size(self: ar_hdr) !u32 {
167 const value = mem.trimRight(u8, &self.ar_size, &[_]u8{@as(u8, 0x20)});
167 const value = mem.trimEnd(u8, &self.ar_size, &[_]u8{@as(u8, 0x20)});
168168 return std.fmt.parseInt(u32, value, 10);
169169 }
170170
......@@ -178,7 +178,7 @@ pub const ar_hdr = extern struct {
178178 fn nameLength(self: ar_hdr) !?u32 {
179179 const value = &self.ar_name;
180180 if (!mem.startsWith(u8, value, "#1/")) return null;
181 const trimmed = mem.trimRight(u8, self.ar_name["#1/".len..], &[_]u8{0x20});
181 const trimmed = mem.trimEnd(u8, self.ar_name["#1/".len..], &[_]u8{0x20});
182182 return try std.fmt.parseInt(u32, trimmed, 10);
183183 }
184184};
src/link/Wasm/Archive.zig+2-2
......@@ -64,7 +64,7 @@ const Header = extern struct {
6464 }
6565
6666 fn getValue(raw: []const u8) []const u8 {
67 return mem.trimRight(u8, raw, &[_]u8{@as(u8, 0x20)});
67 return mem.trimEnd(u8, raw, &[_]u8{@as(u8, 0x20)});
6868 }
6969};
7070
......@@ -162,7 +162,7 @@ pub fn parseObject(
162162 .index => |index| n: {
163163 const long_file_names = file_contents[archive.long_file_names.off..][0..archive.long_file_names.len];
164164 const name = mem.sliceTo(long_file_names[index..], 0x0a);
165 break :n mem.trimRight(u8, name, "/");
165 break :n mem.trimEnd(u8, name, "/");
166166 },
167167 };
168168
test/src/Cases.zig+1-1
......@@ -828,7 +828,7 @@ const TestManifest = struct {
828828
829829 fn next(self: *TrailingIterator) ?[]const u8 {
830830 const next_inner = self.inner.next() orelse return null;
831 return if (next_inner.len == 2) "" else std.mem.trimRight(u8, next_inner[3..], " \t");
831 return if (next_inner.len == 2) "" else std.mem.trimEnd(u8, next_inner[3..], " \t");
832832 }
833833 };
834834
test/standalone/simple/guess_number/main.zig+1-1
......@@ -20,7 +20,7 @@ pub fn main() !void {
2020 try stdout.print("Input too long.\n", .{});
2121 continue;
2222 }
23 const line = std.mem.trimRight(u8, line_buf[0..amt], "\r\n");
23 const line = std.mem.trimEnd(u8, line_buf[0..amt], "\r\n");
2424
2525 const guess = fmt.parseUnsigned(u8, line, 10) catch {
2626 try stdout.print("Invalid number.\n", .{});
tools/docgen.zig+3-3
......@@ -943,10 +943,10 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void {
943943 var cmd_cont: bool = false;
944944 var iter = std.mem.splitScalar(u8, trimmed_shell_content, '\n');
945945 while (iter.next()) |orig_line| {
946 const line = mem.trimRight(u8, orig_line, " \r");
946 const line = mem.trimEnd(u8, orig_line, " \r");
947947 if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] != '\\') {
948948 try out.writeAll("$ <kbd>");
949 const s = std.mem.trimLeft(u8, line[1..], " ");
949 const s = std.mem.trimStart(u8, line[1..], " ");
950950 if (escape) {
951951 try writeEscaped(out, s);
952952 } else {
......@@ -955,7 +955,7 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void {
955955 try out.writeAll("</kbd>" ++ "\n");
956956 } else if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] == '\\') {
957957 try out.writeAll("$ <kbd>");
958 const s = std.mem.trimLeft(u8, line[1..], " ");
958 const s = std.mem.trimStart(u8, line[1..], " ");
959959 if (escape) {
960960 try writeEscaped(out, s);
961961 } else {
tools/doctest.zig+3-3
......@@ -1109,10 +1109,10 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void {
11091109 var cmd_cont: bool = false;
11101110 var iter = std.mem.splitScalar(u8, trimmed_shell_content, '\n');
11111111 while (iter.next()) |orig_line| {
1112 const line = mem.trimRight(u8, orig_line, " \r");
1112 const line = mem.trimEnd(u8, orig_line, " \r");
11131113 if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] != '\\') {
11141114 try out.writeAll("$ <kbd>");
1115 const s = std.mem.trimLeft(u8, line[1..], " ");
1115 const s = std.mem.trimStart(u8, line[1..], " ");
11161116 if (escape) {
11171117 try writeEscaped(out, s);
11181118 } else {
......@@ -1121,7 +1121,7 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void {
11211121 try out.writeAll("</kbd>" ++ "\n");
11221122 } else if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] == '\\') {
11231123 try out.writeAll("$ <kbd>");
1124 const s = std.mem.trimLeft(u8, line[1..], " ");
1124 const s = std.mem.trimStart(u8, line[1..], " ");
11251125 if (escape) {
11261126 try writeEscaped(out, s);
11271127 } else {
tools/incr-check.zig+4-4
......@@ -670,7 +670,7 @@ const Case = struct {
670670 if (std.mem.startsWith(u8, line, "#")) {
671671 var line_it = std.mem.splitScalar(u8, line, '=');
672672 const key = line_it.first()[1..];
673 const val = std.mem.trimRight(u8, line_it.rest(), "\r"); // windows moment
673 const val = std.mem.trimEnd(u8, line_it.rest(), "\r"); // windows moment
674674 if (val.len == 0) {
675675 fatal("line {d}: missing value", .{line_n});
676676 } else if (std.mem.eql(u8, key, "target")) {
......@@ -720,7 +720,7 @@ const Case = struct {
720720
721721 while (true) {
722722 const next_line_raw = it.peek() orelse fatal("line {d}: unexpected EOF", .{line_n});
723 const next_line = std.mem.trimRight(u8, next_line_raw, "\r");
723 const next_line = std.mem.trimEnd(u8, next_line_raw, "\r");
724724 if (std.mem.startsWith(u8, next_line, "#")) break;
725725
726726 _ = it.next();
......@@ -759,7 +759,7 @@ const Case = struct {
759759 if (!std.mem.startsWith(u8, next_line, "#")) break;
760760 var new_line_it = std.mem.splitScalar(u8, next_line, '=');
761761 const new_key = new_line_it.first()[1..];
762 const new_val = std.mem.trimRight(u8, new_line_it.rest(), "\r");
762 const new_val = std.mem.trimEnd(u8, new_line_it.rest(), "\r");
763763 if (new_val.len == 0) break;
764764 if (!std.mem.eql(u8, new_key, "expect_error")) break;
765765
......@@ -774,7 +774,7 @@ const Case = struct {
774774 if (!std.mem.startsWith(u8, next_line, "#")) break;
775775 var new_line_it = std.mem.splitScalar(u8, next_line, '=');
776776 const new_key = new_line_it.first()[1..];
777 const new_val = std.mem.trimRight(u8, new_line_it.rest(), "\r");
777 const new_val = std.mem.trimEnd(u8, new_line_it.rest(), "\r");
778778 if (new_val.len == 0) break;
779779 if (!std.mem.eql(u8, new_key, "expect_compile_log")) break;
780780