mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-03-28 21:34:52 +00:00
replace deprecated mem.indexOf with mem.find
This commit is contained in:
parent
3ecaa34271
commit
8a2e40040b
|
|
@ -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 ..];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user