diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-02-27 19:36:00 +0100 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-02-27 19:36:00 +0100 |
| commit | 1813c0ded8293134bef6b24456a120bd33456b40 (patch) | |
| tree | 9b34ae0d0384f254bb06c0ad6ecc25a730c30ab7 | |
| parent | 908109df2d4990f1fdc3ed32dd84edf0bf9a99a1 (diff) | |
| parent | 8a2e40040b32378cf8a71af1cd5f19d163417f55 (diff) | |
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
| -rw-r--r-- | exercises/065_builtins2.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exercises/065_builtins2.zig b/exercises/065_builtins2.zig index 0fde989..4514b0b 100644 --- a/exercises/065_builtins2.zig +++ b/exercises/065_builtins2.zig @@ -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 ..]; } |
