Merge pull request 'replace deprecated mem.indexOf with mem.find' (#363) from pebose/exercises:indexof-to-find into main

Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/363
This commit is contained in:
Chris Boesch 2026-02-27 19:36:00 +01:00
commit 1813c0ded8

View File

@ -148,9 +148,9 @@ pub fn main() void {
// We'll be seeing @typeName again in Exercise 070. For now, you can
// see that it takes a Type and returns a u8 "string".
fn maximumNarcissism(myType: type) []const u8 {
const indexOf = @import("std").mem.indexOf;
const find = @import("std").mem.find;
// Turn "065_builtins2.Narcissus" into "Narcissus"
const name = @typeName(myType);
return name[indexOf(u8, name, ".").? + 1 ..];
return name[find(u8, name, ".").? + 1 ..];
}