aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/Compile.zig
diff options
context:
space:
mode:
authorAdriĆ  Arrufat <adria.arrufat@gmail.com>2025-12-04 11:10:30 +0900
committermlugg <mlugg@noreply.codeberg.org>2025-12-05 14:31:27 +0100
commit02c5f05e2f0e8e786f0530014e35c1520efd0084 (patch)
tree38b298fa7849d78c7d02294e7bd3b7aed2b7e52c /lib/std/Build/Step/Compile.zig
parent1a420a8dca34db8b632b0451d022ef92f78f96ac (diff)
downloadzig-02c5f05e2f0e8e786f0530014e35c1520efd0084.tar.gz
zig-02c5f05e2f0e8e786f0530014e35c1520efd0084.zip
std: replace usages of std.mem.indexOf with std.mem.find
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
-rw-r--r--lib/std/Build/Step/Compile.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig
index 4f9900ab59..60a8741f0b 100644
--- a/lib/std/Build/Step/Compile.zig
+++ b/lib/std/Build/Step/Compile.zig
@@ -372,7 +372,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});
}
@@ -731,7 +731,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;
@@ -2129,7 +2129,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 ..];