replace deprecated mem.indexOf with mem.find

This commit is contained in:
Paul Ebose 2026-02-27 03:38:26 +01:00
parent 3ecaa34271
commit 8a2e40040b
No known key found for this signature in database
GPG Key ID: EF7590319BD845B1

View File

@ -147,9 +147,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 ..];
}