Commit 1943c2dc68

LemonBoy <thatlemon@gmail.com>
2021-04-09 10:36:05
testing: Use indexOfScalar instead of indexOf
1 parent 5ebcd8c
Changed files (1)
lib
lib/std/testing.zig
@@ -431,7 +431,7 @@ fn printIndicatorLine(source: []const u8, indicator_index: usize) void {
 
 fn printWithVisibleNewlines(source: []const u8) void {
     var i: usize = 0;
-    while (std.mem.indexOf(u8, source[i..], "\n")) |nl| : (i += nl + 1) {
+    while (std.mem.indexOfScalar(u8, source[i..], '\n')) |nl| : (i += nl + 1) {
         printLine(source[i .. i + nl]);
     }
     print("{s}␃\n", .{source[i..]}); // End of Text symbol (ETX)