diff options
| author | Shun Sakai <sorairolake@protonmail.ch> | 2025-04-27 18:03:59 +0900 |
|---|---|---|
| committer | Shun Sakai <sorairolake@protonmail.ch> | 2025-04-27 18:03:59 +0900 |
| commit | 5fc4448e451d7a8e184ac5fbe1e954bff653e36d (patch) | |
| tree | c6f738489cc02ba2478a117b86088f77d0935aea /tools | |
| parent | 3783b1b23c056b30923d6c9dbd2e44c499738198 (diff) | |
| download | zig-5fc4448e451d7a8e184ac5fbe1e954bff653e36d.tar.gz zig-5fc4448e451d7a8e184ac5fbe1e954bff653e36d.zip | |
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.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/docgen.zig | 6 | ||||
| -rw-r--r-- | tools/doctest.zig | 6 | ||||
| -rw-r--r-- | tools/incr-check.zig | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tools/docgen.zig b/tools/docgen.zig index 1e9c409fa4..6b3e898b9f 100644 --- a/tools/docgen.zig +++ b/tools/docgen.zig @@ -943,10 +943,10 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void { var cmd_cont: bool = false; var iter = std.mem.splitScalar(u8, trimmed_shell_content, '\n'); while (iter.next()) |orig_line| { - const line = mem.trimRight(u8, orig_line, " \r"); + const line = mem.trimEnd(u8, orig_line, " \r"); if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] != '\\') { try out.writeAll("$ <kbd>"); - const s = std.mem.trimLeft(u8, line[1..], " "); + const s = std.mem.trimStart(u8, line[1..], " "); if (escape) { try writeEscaped(out, s); } else { @@ -955,7 +955,7 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void { try out.writeAll("</kbd>" ++ "\n"); } else if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] == '\\') { try out.writeAll("$ <kbd>"); - const s = std.mem.trimLeft(u8, line[1..], " "); + const s = std.mem.trimStart(u8, line[1..], " "); if (escape) { try writeEscaped(out, s); } else { diff --git a/tools/doctest.zig b/tools/doctest.zig index 025d59517f..5d45dd9e61 100644 --- a/tools/doctest.zig +++ b/tools/doctest.zig @@ -1109,10 +1109,10 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void { var cmd_cont: bool = false; var iter = std.mem.splitScalar(u8, trimmed_shell_content, '\n'); while (iter.next()) |orig_line| { - const line = mem.trimRight(u8, orig_line, " \r"); + const line = mem.trimEnd(u8, orig_line, " \r"); if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] != '\\') { try out.writeAll("$ <kbd>"); - const s = std.mem.trimLeft(u8, line[1..], " "); + const s = std.mem.trimStart(u8, line[1..], " "); if (escape) { try writeEscaped(out, s); } else { @@ -1121,7 +1121,7 @@ fn printShell(out: anytype, shell_content: []const u8, escape: bool) !void { try out.writeAll("</kbd>" ++ "\n"); } else if (!cmd_cont and line.len > 1 and mem.eql(u8, line[0..2], "$ ") and line[line.len - 1] == '\\') { try out.writeAll("$ <kbd>"); - const s = std.mem.trimLeft(u8, line[1..], " "); + const s = std.mem.trimStart(u8, line[1..], " "); if (escape) { try writeEscaped(out, s); } else { diff --git a/tools/incr-check.zig b/tools/incr-check.zig index d5eb2b2876..5262cbf4b8 100644 --- a/tools/incr-check.zig +++ b/tools/incr-check.zig @@ -670,7 +670,7 @@ const Case = struct { if (std.mem.startsWith(u8, line, "#")) { var line_it = std.mem.splitScalar(u8, line, '='); const key = line_it.first()[1..]; - const val = std.mem.trimRight(u8, line_it.rest(), "\r"); // windows moment + const val = std.mem.trimEnd(u8, line_it.rest(), "\r"); // windows moment if (val.len == 0) { fatal("line {d}: missing value", .{line_n}); } else if (std.mem.eql(u8, key, "target")) { @@ -720,7 +720,7 @@ const Case = struct { while (true) { const next_line_raw = it.peek() orelse fatal("line {d}: unexpected EOF", .{line_n}); - const next_line = std.mem.trimRight(u8, next_line_raw, "\r"); + const next_line = std.mem.trimEnd(u8, next_line_raw, "\r"); if (std.mem.startsWith(u8, next_line, "#")) break; _ = it.next(); @@ -759,7 +759,7 @@ const Case = struct { if (!std.mem.startsWith(u8, next_line, "#")) break; var new_line_it = std.mem.splitScalar(u8, next_line, '='); const new_key = new_line_it.first()[1..]; - const new_val = std.mem.trimRight(u8, new_line_it.rest(), "\r"); + const new_val = std.mem.trimEnd(u8, new_line_it.rest(), "\r"); if (new_val.len == 0) break; if (!std.mem.eql(u8, new_key, "expect_error")) break; @@ -774,7 +774,7 @@ const Case = struct { if (!std.mem.startsWith(u8, next_line, "#")) break; var new_line_it = std.mem.splitScalar(u8, next_line, '='); const new_key = new_line_it.first()[1..]; - const new_val = std.mem.trimRight(u8, new_line_it.rest(), "\r"); + const new_val = std.mem.trimEnd(u8, new_line_it.rest(), "\r"); if (new_val.len == 0) break; if (!std.mem.eql(u8, new_key, "expect_compile_log")) break; |
