diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-12-22 12:50:46 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-12-22 12:50:46 +0100 |
| commit | aa0249d74e573742db3567f589fc6e4a00e1fff8 (patch) | |
| tree | cce61cb7f02072d205a12ae451922f0bf09c13ce /lib/std/Build/Step/Compile.zig | |
| parent | 6b9125cbe662d530160e0732c856aa0da86894c0 (diff) | |
| parent | 02c5f05e2f0e8e786f0530014e35c1520efd0084 (diff) | |
| download | zig-aa0249d74e573742db3567f589fc6e4a00e1fff8.tar.gz zig-aa0249d74e573742db3567f589fc6e4a00e1fff8.zip | |
Merge pull request 'std.ascii: rename indexOf functions to find' (#30101) from adria/zig:indexof-find into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30101
Reviewed-by: Andrew Kelley <andrewrk@noreply.codeberg.org>
Reviewed-by: mlugg <mlugg@noreply.codeberg.org>
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
| -rw-r--r-- | lib/std/Build/Step/Compile.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 7be41ebbea..c57c7750be 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -369,7 +369,7 @@ pub const TestRunner = struct { pub fn create(owner: *std.Build, options: Options) *Compile { const name = owner.dupe(options.name); - if (mem.indexOf(u8, name, "/") != null or mem.indexOf(u8, name, "\\") != null) { + if (mem.find(u8, name, "/") != null or mem.find(u8, name, "\\") != null) { panic("invalid name: '{s}'. It looks like a file path, but it is supposed to be the library or application name.", .{name}); } @@ -716,7 +716,7 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { // Prefixed "lib" or suffixed ".0". for (pkgs) |pkg| { - if (std.ascii.indexOfIgnoreCase(pkg.name, lib_name)) |pos| { + if (std.ascii.findIgnoreCase(pkg.name, lib_name)) |pos| { const prefix = pkg.name[0..pos]; const suffix = pkg.name[pos + lib_name.len ..]; if (prefix.len > 0 and !mem.eql(u8, prefix, "lib")) continue; @@ -1996,7 +1996,7 @@ fn matchCompileError(actual: []const u8, expected: []const u8) bool { // We scan for /?/ in expected line and if there is a match, we match everything // up to and after /?/. const expected_trim = mem.trim(u8, expected, " "); - if (mem.indexOf(u8, expected_trim, "/?/")) |index| { + if (mem.find(u8, expected_trim, "/?/")) |index| { const actual_trim = mem.trim(u8, actual, " "); const lhs = expected_trim[0..index]; const rhs = expected_trim[index + "/?/".len ..]; |
